Mail Archives: djgpp/1999/08/06/00:54:47
In article <933846594 DOT 301468 AT ridge DOT spiritone DOT com> you wrote:
> Try indenting. ie.,
> class Player
> {
> private:
> int lives;
> public:
> void move(void);
> };
Indentation will *never* solve any bug like this. C and C++ both don't
care a bit about how much whitespace you use, so indentation will
never solve a problem as severe as a parse error.
Back to the original problem: The real error is not in the fragment of
code we were given, but somewhere earlier in the program. The 'class
Player' line is not interpreted as the beginning of a statement, by
gcc, which is why it doesn't understand it, and complains with a
'parse error'. It simply didn't expect a class definition, at this
point of the source.
Most probable reason is that a closing } or ; was forgotten, or a
superfluous { found, before the 'class Player' line.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -