Sumit Rajan wrote:
TheReckter wrote:
I can figure out what is wrong with this piece of code, Supposedly
there is an error on line 9 of the following piece of code. If anyone
could help me with this strange issue, the help would be greatly
appreciated, thank you.
#include "stdafx.h"
class WordGenerator
{
public:
WordGenerator(char Format[], int Amount);
}
;
Missing semi-colon.
WordGenerator::WordGenerator(char Format[], int Amount)
{ //Line 9
}
One of those things that the compiler should be able to work out,
because it's obvious that that } is closing the definition of the
class. Yes, a semi-colon is required (although they might change the
standard someday to make it optional as we could get by easily enough
without it). However the compiler should imagine it there and continue
as though it had been there when it comes to reporting subsequent
errors.
One problem I often have is in a constructor where one of the types is
not correctly defined in the argument parameter list and the compiler
prefers to puzzle me with some other statement, possibly a parse error
(instead of pointing to the keyword that is obviously intended to be a
type).