confused among class error messages

1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Vehicle {
   public:
      int passengers; // number of passengers
      int fuelcap; // fuel capacity in gallons
      int mpg; // fuel consumption in miles per gallon
      
      int range(); // compute and return the range
}

// Implement the range member function
int Vehicle::range() 
{
    return mpg * fuelcap;
}


Errors:
- new types may not be defined in a return type
- extraneous `int' ignored
- prototype for `Vehicle Vehicle::range()' does not match any in class `Vehicle'
- `Vehicle Vehicle::range()' and `int Vehicle::range()' cannot be overloaded
- conversion from `int' to non-scalar type `Vehicle' requested

Looking at other examples I can't see that I've gone wrong although clearly I have. Could someone clear up the confusion please?

Thanks
-mcleano
Line 8: you forgot a semicolon ( }; )
I hate mistakes like that! Thank you Bazzy!
Topic archived. No new replies allowed.