LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   C++ problem? Geany in UBUNTU 8.10 (https://www.linuxquestions.org/questions/programming-9/c-problem-geany-in-ubuntu-8-10-a-697774/)

Len Tyree 01-16-2009 02:04 PM

C++ problem? Geany in UBUNTU 8.10
 
i am attempting to learn c++ using "sams teach yourself c++ for linux in 21 days", am doing ok, but ran into a problem at day 8, listing 8.5 and beyond. the code is:
class SimpleCat
{
public:
SimpleCat();
~SimpleCat();
private:
int itsage;
}

SimpleCat::SimpleCat()
// error: new types may not be defined in a return type??? Like book!!
{

do not know how to get around this error??

a little help, please? Thanks, len tyree.

p.s. sent the same message to ubuntu forum.

johnsfine 01-16-2009 02:40 PM

Looks like a very common error: Missing the ; after the } at the end of the definition of a class.

A C++ compiler has a very hard time diagnosing a missing ; because the language has such flexibility that a missing ; almost always looks like some error in some more complex construct, rather than a missing ; in a simple construct.

So for strange error messages, you need to be on the lookout for the missing ;

Len Tyree 01-16-2009 02:46 PM

solved
 
thanks to johnsfine, problem solved.

a simple case of "not looking"

ehanks, len tyree


All times are GMT -5. The time now is 01:33 AM.