Public Group

# Odd Syntax Errors

This topic is 5489 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

So if the declaration in the 'parent' class, in this case 'Node', is virtual, then all subsequent declarations in 'child' classes have to be declared virtual as well? Hmm, can't recall it said that in the book, although knowing me, I probably just missed it :p I'll give that a try.

[EDIT] And vice versa, with that 'parent-child' bit?

[EDIT x2]Okay, added it in, still nothing doing. If anything, I got more syntax errors.. Very odd, this is...

##### Share on other sites
Quote:
 Original post by SirLuthorSo if the declaration in the 'parent' class, in this case 'Node', is virtual, then all subsequent declarations in 'child' classes have to be declared virtual as well? Hmm, can't recall it said that in the book, although knowing me, I probably just missed it :p I'll give that a try.[EDIT] And vice versa, with that 'parent-child' bit?

All functions with the same name and parameters as a function that is declared as virtual in a base class are implicitly virtual. This has little to do with the problem in hand though, as you arn't declaring the function as being virtual in the Node base class, you missed the virtual keyword.

##### Share on other sites
Quote:
 Original post by SirLuthor[EDIT x2]Okay, added it in, still nothing doing. If anything, I got more syntax errors.. Very odd, this is...

whats in tileclass.hpp?

##### Share on other sites
It contains a tile class, i.e 'class tileClass', which I shall, for the record, show here, just in case it may aid someone in aiding me :)

#ifndef TileCLASS_HPP#define TileCLASS_HPPclass tileClass{    public:        tileClass();        ~tileClass();        int getTileID() const;        void setTileID(int tempID);        int getDirOpen(int tempDir);        int getGold() const;        void removeGold();    private:        int tileID;        bool dirOpenUp;        bool dirOpenRight;        bool dirOpenDown;        bool dirOpenLeft;        bool gold;};#endif

##### Share on other sites
//***   Abstract Data Type: Node || Base class for other node types   ***\\

That last backslash probably isn't followed by a space and is absorbing the newline character as a control character, resulting in the following line also being commented out. Don't use a backslash at the end of the comment.

##### Share on other sites
Quote:
 Original post by joanusdmentiaTake a look at your comments...//*** Abstract Data Type: Node || Base class for other node types ***\\That last backslash probably isn't followed by a space and is absorbing the newline character as a control character, resulting in the following line also being commented out. Don't use a backslash at the end of the comment.

Now there's onc I didn't know! Thanks a lot, I never would have guessed in a million years that that was a bad thing, even if doesn't turn out ot be causing my problem :)

[EDIT] Dude! It worked! A thousand thanks, I never would have guessed that was the problem! Consider yourself rated :) And, my thanks to all who contributed to solving of my problem! I don't know where I would be without this great community!

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 15
• 12
• 9
• 11
• 15