Sign in to follow this  

Odd Syntax Errors

This topic is 4814 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

Quote:
If you need to write something long, write it up in Notepad (or equivalent) first, then hit reply and paste the whole thing into the text box.

Luckily, that's what I've been doing lately. Of course, it just times out... But hey, Ekim_Gram, thanks for the offer, I'll send it over soon!

Share this post


Link to post
Share on other sites
Wow, I timed out too trying to post what he wanted to. If anybody would like to help, PM me and I'll give you the post.

[Edited by - Ekim_Gram on October 10, 2004 11:14:24 AM]

Share this post


Link to post
Share on other sites
Okay folks, since I am utterly unable to post what I intended to (and so are others, it appears), I have taken the liberty to post it to another forum, so I can provide the link, and allow you all to see my problem, without having to use email :) Again, my thanks to anyone who goes out of their way to help a poor, misguided programmer :)

Link: http://www.holymight.com/forum/viewtopic.php?t=97

Thanks!

Share this post


Link to post
Share on other sites
First error i can see is the

Node * Insert(TILE * theData)=0;

line of code in class Node.

You missed the virtual keyword.

Try correcting that and see what happens.

virtual Node * Insert(TILE * theData)=0;

Share this post


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

This topic is 4814 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this