title: Can't set private static member variables with accessor
body: <p>Zombie.h has some static member variables. Read.cpp, which includes Zombie.h, knows the values that need to go in those variables. I want read.cpp to set those variables with something along the lines of</p>
  
  <pre><code>int Zombie::myStaticInt = 4;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Zombie::setStaticVar(4);
  </code></pre>
  
  <p>I've tried everything I can think of, including using a public static accessor function and even making the static variables themselves public, but I've been getting a lot of "undefined reference" or "invalid use of qualified-name" errors. By looking into those I found out how to set Zombie.h's private static member variables from Zombie.cpp, but I don't have a Zombie.cpp file, just read.cpp. Can I set them from Read.cpp instead, and if so, how?</p>
  
  <pre><code>// In Zombie.h
  class Zombie {
  public:
      static void setMax(int a_in, int b_in, int c_in) {
          a = a_in;
          b = b_in;
          c = c_in;
      }
  private:
      static int a, b, c;
  }
  
  // In read.cpp
  #include "Zombie.h"
  ...
  main() {
      int Zombie::a; // SOLUTION: Put this outside the scope of main and other functions
      int Zombie::b; // SOLUTION: Put this outside the scope of main and other functions
      int Zombie::c; // SOLUTION: Put this outside the scope of main and other functions
      int first = rand() * 10 // Just an example
      int second = rand() * 10 // Just an example
      int third = rand() * 10 // Just an example
      Zombie::setMax(first, second, third);
      return 0;
  }
  </code></pre>
  
  <p>This yields (Updated)
  (Move first three lines of main outside of main() to solve this)</p>
  
  <pre><code>invalid use of qualified-name 'Zombie::a'
  invalid use of qualified-name 'Zombie::b'
  invalid use of qualified-name 'Zombie::c'
  </code></pre>