T
Thomas Nelson
I'm trying to write a function that uses function pointers. Here's my
errors:
Board.cc:111: error: expected ',' or '...' before 'p1'
Board.cc:111: error: prototype for 'int Board:
lay_game(int (*)(const
Board&))' does not match any in class 'Board'
Board.h:18: error: candidate is: int Board:
lay_game(int (*)(const
Board&), int (*)(const Board&), bool)
Here's Board.cc:111:
int Board:
lay_game(int(const Board &) p1, int(const Board &) p2,
bool silent=false)
And here's Board.h:18:
int play_game(int(const Board &), int(const Board &), bool
silent);
What have I done wrong? I wanted to use a typedef to simplify this,
but Board has to be declared to use it in a typedef, and I want to use
the typedef in my Board declaration. Any help would be great.
Thanks,
Tom
errors:
Board.cc:111: error: expected ',' or '...' before 'p1'
Board.cc:111: error: prototype for 'int Board:
Board&))' does not match any in class 'Board'
Board.h:18: error: candidate is: int Board:
Board&), int (*)(const Board&), bool)
Here's Board.cc:111:
int Board:
bool silent=false)
And here's Board.h:18:
int play_game(int(const Board &), int(const Board &), bool
silent);
What have I done wrong? I wanted to use a typedef to simplify this,
but Board has to be declared to use it in a typedef, and I want to use
the typedef in my Board declaration. Any help would be great.
Thanks,
Tom