View Single Post
Old 08-20-2002, 06:08 AM   #3 (permalink)
kenshi
Registered User
 
kenshi's Avatar
 
Join Date: Jun 2002
Location: Antarctica
Posts: 43
kenshi is on a distinguished road
Send a message via ICQ to kenshi
You have a bit of a mess there. First of all, like redhead said, you have a function of int type that returns nothing. You either need to make it return something or declare it void. Second, the function is going to be called from the cout line, and the cout line within the function will be performed, which is desired, but the return value of the function will also be printed, which is not. I think the easiest way to change it up is to make Car::itsModel() return a char pointer that points to a string holding the model name. Do something like:

Code:
char* Car::itsModel()
{
  char[] model = "1990 Legacy";
  return model;
}
kenshi is offline   Reply With Quote