Also es muss irgendwas mit meinen Zugriffsmethoden nicht stimmen, aber meiner Meinung nach scheint alles korrekt zu sein:
Erstmal meine Klasse:
Header
Code
		
					
				class Gamestate{
private:
	unsigned int state;
public:
	Gamestate();
	void setGamestate(const unsigned int gamestate);
	int getGamestate();
	static const int gamestates=2;
	//0 = Startbildschirm, 1=Spiel
};
Klasse:
C
		
					
				#include "Gamestate.h"
#include "SDL.h"
Gamestate::Gamestate(){
	this->state=0;
}
int Gamestate::getGamestate(){
	return this->state; //hier break, anscheinend Fehler
}
void Gamestate::setGamestate(const unsigned int gamestate){
	if (gamestates >gamestate){
		this->state=gamestate;
	}
}Aufruf in meiner main Methode per:
Code
		
			Gamestate status;
if (status.getGamestate()==0){
  if (ENTER Taste wird gedrückt){
      status.setGamestate(1);
  }
}
else if (status.getGamestate()==1){
     //Spiel fängt an
}Folgender Fehler:
Unhandled exception at 0x00412e26 in SDLGame.exe: 0xC0000005: Access violation reading location 0xcccccccc.
 
		