Correct place to initialize class variables?
<p>Where is the correct place to initialize a class data member?
I have the class declaration in a header file like this:</p>

<p>Foo.h:</p>

<pre><code>class Foo {
private:
    int myInt;
};
</code></pre>

<p>Then I try to set a value to myInt in the corresponding .cpp file:</p>

<p>Foo.cpp:</p>

<pre><code>int Foo::myInt = 1;
</code></pre>

<p>I get a compiler error for redefining myInt. What am I doing wrong???</p>
