Enrui
February 13th, 2010, 04:18 PM
When I run my code through G++ I get the following error. I recently re-wrote my code on the advice of DWhitney and found that I'm not sure how to use certain features.
Here's my problem...
error: request for member 'returnModel' in 'Ferrari' which is of non-class type 'car*'
now I'm aware that I have the following function defined within the class.
returnModel()
{
return (carModel);
}
I have also defined Ferrari within main()
car* ferrari = new car ( ...data here...)
Now I entered this code.
cout << ferrari.returnModel()
and got the above error, could someone supply a hint.
Here's my problem...
error: request for member 'returnModel' in 'Ferrari' which is of non-class type 'car*'
now I'm aware that I have the following function defined within the class.
returnModel()
{
return (carModel);
}
I have also defined Ferrari within main()
car* ferrari = new car ( ...data here...)
Now I entered this code.
cout << ferrari.returnModel()
and got the above error, could someone supply a hint.