For loop keeps crashing program c++
<p>This specific chunk of code from my much longer program keeps crashing. It compiles fine but then windows ends it. </p>

<pre><code> out_stream_names.open("names.dat");
 for(int i = a.size(); i&gt;0 ; i=i-1)
       {
             out_stream_names &lt;&lt; a[i] &lt;&lt; endl;
       }
 out_stream_names.close();
</code></pre>

<p>I would like to figure out why it keeps crashing. I'm not asking for code to copy. Thanks. </p>
