#include "stdafx.h"
class Player{
private:
int x;//player x/y position
int y;
public:
Player(int _x, int _y);//constructor
~Player(void);//destructor
};
Player::Player(int _x, int _y){
x = _x;
y = _y;
}
int main(int argc, char* argv[])
{
printf("Hello World!\n");
Player p1(10,20);
Player p2(310,210);
return 0;
}
I just try this sample program and it compiles without a problem.
and I just google your error. Probally you are not the only one who
get a error like this. well first search is MSDN page that contain details about this error.
it says torken error.
so sounds like it's little bit complicated to see this without looking at other source codes and dependencies.
anyway a one pice of advice , to avoid unnecessary problems always use a standard. Don't use _ starting variables. They are reserved to use internally inside the C++ compiler itself. Try it again with removing _ starting variable names.
If you need to learn about how to name your variables properly google "coding standards C++"
* you can use _ characters on variables but don't start with it.