title: How to initialize private static members in C++?
body: <p>What is the best way to initialize a private, static data member in C++?  I tried this in my header file, but it gives me weird linker errors:</p>
  
  <pre><code>class foo
  {
      private:
          static int i;
  };
  
  int foo::i = 0;
  </code></pre>
  
  <p>I'm guessing this is because I can't initialize a private member from outside the class.  So what's the best way to do this?</p>