title: C++ Initialization list for reference variables
body: <p>I am trying to initialize a reference object through the initialization list in the class constructor and I would need your inputs on why I am not able to initialize it in the following way. Am I not allowed to initialize a reference in the following way?</p>
  
  <pre><code>class ObjectA
  {
  
  private:
      char* _nameA; 
      int _velocityA;
  
  public:
          ObjectA(char* name, int velocity)
          {
              name = name;
              _velocityA = velocity;
          }
  };
  </code></pre>
  
  <p>I get an error in the following initialization list which says <strong>a reference of type "ObjectA &amp;" (not const-qualified) cannot be initialized with a value of type "char *"</strong> Why exactly am I getting this error? and what am I doing wrong?</p>
  
  <pre><code>class ObjectB
  {
  
  private:
      ObjectA&amp; objA;
  
  public:
          ObjectB(char* engName, int _velocityA):objA(engName, _velocityA)
          {
          }
  };
  </code></pre>