C++ and initialize const variable
<p>I want to create class Test with const int variable with name "a". After that I need create constructor where variable "a" get value =10. I Create class test and in test.h I create <code>const int a;</code> in class Test.h and in test.cpp I have something like that:</p>

<pre><code>#include "stdafx.h"
#include "Test.h"


Test::Test(void)
{
    a = 10;
    b = 20;
    size = 20;
    tekst[size];
    }

Test::~Test(void)
{
}
</code></pre>

<p>and this is test.h:</p>

<pre><code>#pragma once
class Test
{

    const int a;  



public:
    Test(void);
    ~Test(void);
    int b;
    char *tekst;
    int size;
    static double d;
    int y;
};
</code></pre>

<p>but I get error:</p>

<pre><code>Error   1   error C2758: 'Test::a' : must be initialized in constructor base/member initializer list    c:\users\bożydar\documents\visual studio 2012\projects\consoleapplication1\consoleapplication1\test.cpp 6
Error   2   error C2166: l-value specifies const object c:\users\bożydar\documents\visual studio 2012\projects\consoleapplication1\consoleapplication1\test.cpp 7
</code></pre>
