what's wrong with defining a 2d vector as a data member of a class in this way?
<p>I am coding a class which has a 2d vector in its private data members named board,
I have defined the vector like this in the header file of class:
World.h:</p>

<pre><code>vector &lt;vector&lt;Cell&gt; &gt; board;
vector &lt;Cell&gt; columns;//Cell is name of another class
</code></pre>

<p>World.cpp:</p>

<pre><code>columns.resize(number_of_columns);
for(int i=0;i&lt;number_of_lines;i++) board.push_back(number_of_columns);
</code></pre>

<p>and after this i tried to access the members of the vector in this way:</p>

<pre><code>board[i][j]
</code></pre>

<p>i had errors which said </p>

<blockquote>
  <p>Error  error C2065: 'board' : undeclared identifier</p>
</blockquote>

<p>what's wrong with it?</p>

<hr>

<p>more of code added:
World.h:</p>

<pre><code>class World {
    private :
    bool ring;
    int lines, columns ;
    vector &lt;Cell&gt; columns;
        vector &lt;vector&lt;Cell&gt; &gt; board;
public:
    //blahhhh
    };
</code></pre>

<p>World.cpp:</p>

<pre><code>World:: World(int l , int c)
{
    columns.resize(c);
    for(int i=0;i&lt;l;i++) board.push_back(columns);
}
</code></pre>

<p>i this function it doesn't know what is board! and have a error because of this.</p>
