title: Avoiding redeclaration for header to source file
body: <p>Let's say I have two files foo.h and foo.cpp</p>
  
  <p><strong>foo.h</strong></p>
  
  <pre><code>class foo
  {
      public:
          Foo(); 
          ~Foo(); 
      private:
          /*
          Member functions
          */
          static void DoThis();
          /*
          Member variables
          */
          static int x;
  
  
      protected:  
  };
  </code></pre>
  
  <p><strong>foo.cpp</strong></p>
  
  <pre><code>#include "foo.h"
  
  int foo::x;
  
  void foo::DoThis()
  {
      x++;
  }
  </code></pre>
  
  <p>Can I avoid the hassle of having to declare each variable in foo.cpp again? If I removed this line <code>int foo::x;</code> I would get a linker error for unresolved external symbol. </p>
  
  <p>Is there another way of doing this without having to type a line for each variable I'm planning to use?</p>