title: Enumerations in C++
body: <p>I have the code</p>
  
  <pre><code>void switchstate(gamestates state) --line 53
  { --line 54
      switch(state)
      case state_title:
          title();
          break;
      case state_about:
          break;
      case state_game:
          break;
      case state_battle:
          break;
  }
  
  enum gamestates
  {
  state_title, state_about, state_game, state_battle,
  };
  
  
  int main( int argc, char* args[] )
  {
  gamestates currentstate = state_title;
  startup();
  load_resources();
  switchstate(currentstate); --line 169
  return 0;
  }
  </code></pre>
  
  <p>and when I try to compile I get the errors:</p>
  
  <p>\main.cpp:53: error: 'gamestates' was not declared in this scope<br>
  \main.cpp:54: error: expected ',' or ';' before '{' token<br>
  \main.cpp: In function 'int SDL_main(int, char**)':<br>
  \main.cpp:169: error: 'switchstate' cannot be used as a function  </p>
  
  <p>I've never used enumerations before so I'm confused on what's not working. </p>