I KEEP GETTING THESE TWO ERRORS:
1. error C2011: 'vehicle' : 'class' type redefinition
2.see declaration of 'vehicle'
#include <iostream>
#include <string>
#include "vehicle_imp.h"
//IMPLEMENTATION
vehicle::vehicle()
{
x = 0;
y = 0;
speed = 0;
facing = 0;
}
void vehicle::turn(int facing)
{
facing=facing+90;
if(facing==360)
{
facing=0;
}
}
void vehicle::accelerate(int vel)
{
speed = speed + vel;
if (speed < 0) speed = 0;
if (speed > 200) speed = 200;
}
void vehicle::move()
{
if(facing==0)
{ x=x+speed;}
else if(facing==90)
{y=y+speed;}
else if(facing==180)
{x=x-speed;}
else if(facing==270)
{y=y-speed;}
}
//SPECIFICATION
#include <iostream>
#include <string>
using namespace std;
class vehicle
{
public:
vehicle();
void turn(int facing);
void accelerate(int speed);
void move();
private:
int facing;
int speed;
int x;
int y;
};
//MAIN CPP FILE
#include <iostream>
#include <string>
#include "vehicle.h"
#include "vehicle_imp.h"
using namespace std;
int main()
{
return 0;
}