Quote:Original post by Menace2Society
Sams Teach Yourself C++ in 21 Days.
SAMS produces nothing but crap. I hope you kept your receipt and can return the book, if not... well, winter is coming, I guess you could always use it in your fireplace?
'Cat' Undeclared identifierThis means the compiler doesn't know what the heck you're talking about when you mention Cats, or has been confused by earlier errors. The compiler needs to see the definition of the class ("class Cat { ... };"), either by having it in each file using Cat before that point, or by having a file containing it #included before that point.
Other errors:
int _tmain(int argc, _TCHAR* argv[]){ Cat yourCat(catSize, catWeight); // neither of these variables have been defined, try plugging in 42 for each instead}
Cat::Cat(int size, int weight){ this.size = size; // "this" is a pointer, not a reference or direct variable -- you want "this->size" instead //...or, better yet, and "initializer list" (googleable term for you there), which no author of a Sams book will probably have even heard of. ...