syntax

M

Michael Sgier

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
};
 
?

=?ISO-8859-1?Q?Stefan_N=E4we?=

Michael said:
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.
 
K

Karl Heinz Buchegger

Michael said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

refs 10
Passing an aray of objects question? 12
array 1
Static Binding Problem: 2
Better program design? 23
error: syntax error before '*' token 3
visibility/passing of variables 5
Explicit specialization syntax 6

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top