title: c++ vector size zero when calling in draw() function
body: <p>I created a vector to store 96 computed values in it. The function is fine and returning the vector with size=96.</p>
  
  <p>However when I call the vector in my draw-function its size is zero causing an access violation.</p>
  
  <pre><code>vector&lt;float&gt;Icosphere::calcIcosphere() {
  //variables
     vector&lt;float&gt; vertices (12*8)
     //computing values
  return vertices;   //at this point the size=96
  }
  
  void Icosphere::drawIcosphere() const{
  //variables
  //create VAO
  //generate buffer for VBO &amp; IBO
  vector&lt;float&gt; vertices; //here its size=0 and stays 0
  //bind buffers and fill with vector and indices
  ....
  glDrawElements(...); //causing access violation
  ...
  }
  </code></pre>
  
  <p>I do not understand why the vector becomes 0 after returning its values. I guess I missed some basics.</p>
  
  <p>Can somebody help?</p>