Hi,
I am trying to write a class that uses vectors that contain another class. When I compile my code using g++ I get the following error that I don't understand:
In file included from cars.cpp:5:
car.h:24: error: syntax error before `;' token
car.h:25: error: syntax error before `;' token
What is wrong with the syntax below?
#ifndef CAR_H
#define CAR_H
class Car {
public:
Car(int yr, const char *mk, const char *mod, int maxPass);
~Car();
Person getDriver();
Person getPassenger();
int getSpeed();
int howManyPassengers();
void turnIgnitionOn();
void turnIgnitionOff();
void accelerate(int x);
void decelerate(int x);
void addDriver(Person name);
void removeDriver();
void addPassenger(Person name);
void removePassenger();
void showCar();
private:
int year, maxPassengers, numberOfPassengers, speed;
std::vector<Person> driver_seat;
std::vector<Person> passengers;
char make[20];
char model[20];
bool ignitionSwitch;
};
#endif