At what point does the memory get allocated to a constant variable in c++?
<p>As much as i know, constant class members must be initialized before the constructor runs, but since they cannot be initialized in the class body (as it is just a prototype), therefore we need to initialize it inside initializer list. My question is when does memory gets allocated to a constant variable, and what is the order of execution? </p>

<pre><code>class constant
{
    const int a;
    public:
    constant(int k):a(k)
    {   
        cout&lt;&lt;"a is "&lt;&lt;a&lt;&lt;endl;
    }   
};

int main()
{
    constant cl(5);
    return 0;
} 
</code></pre>

<p>EDIT: Is it true that constant variables need to be initialized at the point where they are allocated memory?</p>
