title: Can const member variable of class be initialized in a method instead of constructor?
body: <p>I have a class and want to create a const int variable but the value for the variable is not available to me in constructor of the class.</p>
  
  <p>In initialization method of the class i get the value. Can I assign it in that method?
   As I am assigning it only once (as const says) why it isn't working? </p>
  
  <p>Code is as Following [Just a ProtoType] :</p>
  
  <p><strong>File : A.h</strong></p>
  
  <pre><code>Class A
  {
    private :
    const long int iConstValue;
  
    public :
    A();
    initClassA();
  }
  </code></pre>
  
  <p><strong>File : A.cpp</strong></p>
  
  <pre><code>A::A()
  {
   //CanNot initialize iConstValue (Don't have it)
  }
  
  A::initClassA(some params)
  {
   // calculation according to params for iConstValue
   iConstValue = (some value)
  }
  </code></pre>
  
  <p>This is not working. Somebody has any Solutions?</p>
  
  <p><strong>NOTE :</strong> I <strong>Can not get value for iconstValue in constructor</strong> by any way as there are some restriction. So Please don't suggest to do that.</p>