Why does not work vector.clear()
<p>Need help.. Please tell me why " A.clear() " does not clear the first column too?
........................................................</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;
using namespace std;

int N, M;
vector&lt; vector&lt;int&gt; &gt; A;
int main()
{
    cin &gt;&gt; N &gt;&gt; M;
    A.resize(N + 2);
    for (int i = 0; i &lt;= N; ++i)
    {
        A[i].resize(M + 2);
    }
    A.clear();
    for (int i = 0; i &lt;= N; ++i)
    {
        for (int j = 0; j &lt;= M; ++j)
        {
            cout &lt;&lt; A[i][j] &lt;&lt; ' ';
        }
        cout &lt;&lt; '\n';
    }
    return 0;
}
</code></pre>
