okay so i know how to do a class program with just a header file and main. However when it comes to making using an external constructor file, i am stumped.
this is what i have so far. it may look like the one i had before and it is, but Im just using a different method of writing it. Thank you!
#ifndef __TRIP_H__
#define __TRIP_H__
usingnamespace std;
class Trip
{
// Public functions go here
public:
Trip();
void intro();
float mileage(int miles, float gallons);
float tripcost(float costpergallon, float milespergallon, int totaldistance);
private:
// private data / functions go here (none for now)
};
#endif
- trip.cpp, lines 13, 21: You need to give your functions return types. In your header, you declared them as floats, so these lines should start with float as well.
- trip.cpp, line 13: 'gallons' is supposed to be a float according to your header file. Always make sure your prototype and function body match exactly.
Ah... upgrade to wxDev-C++ or Code::Blocks, and then we might be able to help you a little further...
(Seriously, Dev-C++ belongs in a museum at this point).