 <p>You can initialize vectors this way:</p> <pre><code>vector&lt;int&gt; a(2,3); //vector a contains 2 elements: 3 and 3 a[0] = 4;//vector a contains 2 elements: 4 and 3 vector&lt;int&gt; b; b = a; </code></pre> <p>And there are some other ways you can check here: <a href="http://www.cplusplus.com/reference/vector/vector/vector/" rel="nofollow">http://www.cplusplus.com/reference/vector/vector/vector/</a></p> <p>EDIT:</p> <p>If you want to initialize with zeros:</p> <pre><code>vector&lt;int&gt; a(2); </code></pre> <p>should do the work, the vector a will contain 2 zeros.</p>