I'm new to C++ and I am trying to separate class files for a game I made, but when i do, VS generates a load of errors.
Cube.h:
#include "stdafx.h"
#ifndef CUBE_H
#define CUBE_H
struct PlayerCube
{
//code
};
#endif //CUBE_H
Cube.cpp:
#include "cube.h"
#include "stdafx.h"
using namespace std;
PlayerCube::PlayerCube(){}
void PlayerCube::cube_movement(){}
void PlayerCube::show_cube(){}
Main:
#include "cube.h"
#include "stdafx.h"
using namespace std;
int main ()
{
//code
}
any ideas would help! :)
EDIT: Keats answer reduced my errors from 96 down to 3!
I now just have 3 C2679 errors stating that "binary >> : no operator found"
EDIT: Found out my problems, just one more remains!
Everything builds fine, but when I run my program, it crashes, ".exe has stopped working"?