Hello guys i had this error while i was compiling
error:'unisgned int vehicle::accelerate' is not a static member of 'class vehicle'
Any idea how to fix this?
Header file
class vehicle
{
public:
enum Switch
{
SWITCH_ON=0,
SWITCH_OFF
};
vehicle();
~vehicle();
bool powerSwitch(Switch );
unsigned int accelerate(unsigned int );
unsigned int decelerate(unsigned int );
bool isMoving();
unsigned int getSpeed();
unsigned int setSpeed(unsigned int);
private:
unsigned int speed;
bool moving;
};
vehicle.cpp
unsigned int vehicle::accelerate(amount)
{
if(moving==true;){
speed+=amount;
}
return speed;
}