By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,918 Members | 2,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,918 IT Pros & Developers. It's quick & easy.

syntax

P: n/a
Hi
what the heck is my syntax error here?
THANKS and regards
Michael
PS: At what address is the FAQ located?

world.h:65: error: syntax error before `;' token

class CWorld
{
protected:
void OnPrepare(CTerrain *terrain);

public:
void Prepare() { OnPrepare(CTerrain *terrain); } // here i get the
//syntax error above
};
Sep 14 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Michael Sgier wrote:

Hi
what the heck is my syntax error here?
THANKS and regards
Michael
PS: At what address is the FAQ located?

world.h:65: error: syntax error before `;' token

class CWorld
{
protected:
void OnPrepare(CTerrain *terrain);

public:
void Prepare() { OnPrepare(CTerrain *terrain); } // here i get the
//syntax error above
When you call a function, you provide the arguments. Don't repeat the
type of the arguments:

A function:

void foo( int a )
{
}

and a call to it looks like this

int main()
{
foo( 5 );
int b = 8;
foo( 8 );
}

but not

int main()
{
foo( int a ); // this is *not* a call to a function
// it looks a little bit like a function declaration if there
// had been a return type specified.
}
void Prepare() { OnPrepare(CTerrain *terrain); } // here i get the

I guess you wanted:
void Prepare() { OnPrepare(terrain); }

But that leaves you with the question: where do I get terrain from.

As for the FAQ:
The FAQ doesn't help you very much at your stage. What you need is a good beginners
book about C++. Most of your problems so far are of the very simple nature.
The FAQ assumes that you know at least a little bit about what you are doing.

--
Karl Heinz Buchegger
kb******@gascad.at
Sep 14 '05 #2

P: n/a
Michael Sgier wrote:
Hi
what the heck is my syntax error here?
THANKS and regards
Michael
PS: At what address is the FAQ located?

world.h:65: error: syntax error before `;' token

class CWorld
{
protected:
void OnPrepare(CTerrain *terrain);

public:
void Prepare() { OnPrepare(CTerrain *terrain); } // here i get the syntax error above
void Prepare() { OnPrepare(terrain); }
};


(IF CTerrain is poperly (forward) declared)

/S.
Sep 14 '05 #3

P: n/a
Michael Sgier <sg***@nospam.ch> writes:

PS: At what address is the FAQ located? http://www.parashift.com/c++-faq-lite/

class CWorld
{
protected:
void OnPrepare(CTerrain *terrain); public:
void Prepare() { OnPrepare(CTerrain *terrain); } // here i get the
//syntax error above
};


OnPrepare is a function elsewhere. Prepare is a function that calls
OnPrepare, but when you call a routine you don't provide the arg types,
just the args.
Sep 14 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.