title: C++ - static objects/variables used across a project vs. using pointer/reference arguments
body: <p>I'm writing a simple memory game (the one with the cards you flip) with C++ and SDL, and I'm finding it difficult to decide whether I'd use a class such as this:</p>
  
  <pre><code>class Game {
  public:
     static StartMenu* sMenu;
     static OptionsMenu* oMenu;
     static GameBoard* board;
  
     static Card cards[36];
  }
  </code></pre>
  
  <p>And then refer to them like this</p>
  
  <pre><code>Game::menu-&gt;selectedItem = 1;
  </code></pre>
  
  <p>Or should I just construct the project so that I'd instantiate the objects somewhere and then pass them to functions as pointers/references (I'll figure out which ones I should use later)? Like this</p>
  
  <pre><code>void processInput(SDL_Event event, StartMenu*&amp;*&amp; menu) {
      ...
      menu-&gt;selectedItem = 1;
      ...
  }
  </code></pre>
  
  <p>Or is it just a matter of preference? The latter one seems "cleaner" but the former is more flexible...</p>