A dynamic 2 dimensional array in C++?
<p>I am trying to build a 2 dimensional array in C++ while I don't know how many rows I will have. Here is some code:</p>

<p>In the header file:</p>

<pre><code>class model
{
         ... ...

    float vertices[][3];

         ... ...
}
</code></pre>

<p>And in the .cpp file:</p>

<pre><code> istringstream iss(str);
 for (int i = 0; i &lt;=2; i++)
     {
         iss &gt;&gt; vertices[counter][i];
     }
</code></pre>

<p>Is this a proper way to handle it? I got a segmentation fault, I just want to make sure it's not caused by the way I use arrays. Also is there a better way to handle this, thanks.</p>
