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. |
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 ; |
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. |