I am in the process of changing my C++ code into C code because I find myself gravitating toward more purely functional programs and am not really using any of the C++ features. The speedy compiling is also a plus.
I am having trouble with this particular bit in my header:
void gameLoop();
void doStuff();
enum GameState
{
MENU, PLAY, EXIT
};
GameState gameState;
which I want to use for functions like this in my source:
void gameLoop()
{
while (gameState != GameState::EXIT)
{
doStuff();
}
}
::; you need to usewhile (gameState != EXIT)(this should also work in C++ and that's why in C++ you should use enum class.GameState::EXITfrom the question and now your switch statement is malformed.