I created a class and when trying to print the result of a class method to the console my compiler says
The line it chokes on looks like this:
Illegal operand types:
The operands are of the wrong type, casting the operands to a different type.
This is where I am stumped. mycat is an instance of the class cat. The method getAge returns an int, so I can't see any reason for this peice of code not to work.
cout << "Your cat is " << mycat.getAge << " years old.";
Here is the getAge method.
I'm new to C++, haveing an already solid grasp of C, trying to migrate towards C++.
Can anyone please lend a hand.