#include<iostream>
usingnamespace std;
class Animal
{
public:
Animal(int);
Animal();
~Animal(){}
int GetWeight() const { return itsWeight;}
void Display() const ( cout<< itsWeight;} <--This is where the error is
private:
int itsWeight;
};
int main()
{
int number;
cout<<"enter number"<<endl; <-- This is OK
cin>>number;
return 0;
}
When I compile it it gives me an error:
error C2061: syntax error : identifier 'cout'
This is on the following line:
void Display() const ( cout<< itsWeight;}
Why does it complain about this cout and not the:
cout<<"enter number"<<endl;