Method not a static member of a class

c++, class, header

Solution

You are missing the type in the parameter list:

unsigned int vehicle::accelerate(unsigned int amount)
{
  .....
}

Problem

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; } ```

Original source