title: Constructor return value
body: <p>Could you tell me what is wrong with my class constructor?
  Code:</p>
  
  <pre><code>CVector::CVector (int size_)
  {
      if (size_ &gt; 0)
      {
          this-&gt;size = size_;
          this-&gt;data = new double[size];
          for (int i = 0; i &lt; size; i++)
          { 
              (*this)(i) = i;
          }
       }
       cout &lt;&lt; "constructor end" &lt;&lt; endl;
       return;
  }
  </code></pre>
  
  <p>Usage example:</p>
  
  <pre><code>tvector = CVector(6);
  </code></pre>
  
  <p>I get an access violation after <code>"constructor end"</code> output.</p>
  
  <p><strong>Update</strong>: 
  Constructor call was incorrect.
  Using</p>
  
  <p><code>CVector tvector(6);</code>
  worked.</p>