X

Missing semi-colon

Guest Author

Thought I'd highlight this error message:

class foo
{
foo();
}
foo::foo()
{ }
$ CC -c c.cpp
"c.cpp", line 6: Error: A constructor may not have a return type specification.
1 Error(s) detected.

The problem is that the class definition is not terminated with a semi-colon. It should be:

class foo
{
foo();
}; // Semi-colon
foo::foo()
{ }

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.