Jump to content
  • Advertisement
Sign in to follow this  
SirLuthor

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by SirLuthor
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?


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 this post


Link to post
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 this post


Link to post
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_HPP

class 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 this post


Link to post
Share on other sites
Take 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.

Share this post


Link to post
Share on other sites
Quote:
Original post by joanusdmentia
Take 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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!