static class member in c++
<p>I have a question related to the static class member in C++. Based on my understanding of C++, the static class number is supposed to exist before the class's instance is created. It is possible to initialize the const static member variable, but for the non-const static member we cannot initialize it within the class. Therefore, my question is where we should initialize the non-const static class. It seems to me that the only stage for the non-const static class is before the main program is run as the following codes illustrate:   </p>

<pre><code>    using namespace std;
    class C
    {
    public:
        static int Value;

    };

    int C::Value = 2;

    int main()
    {
        // int C::Value = 2; //ERROR!
        cout&lt;&lt;C::Value&lt;&lt;endl; 
        return 0;
    }
</code></pre>

<p>Are there other ways to initialize it? Thanks!</p>
