How does C++ proceed for += with a variable without value? : <p>i am currently learning C++ and i had a question about some "weird" things i noticed while testing what i have learnt.</p>

<p>So i use this :</p>

<pre><code>int marc[9];
int sum = 0;

for (int x =0; x &lt; 9; x++) {
    marc[x] = x*4;
    sum += marc[x];
}
cout &lt;&lt; sum &lt;&lt; endl;
</code></pre>

<p>And i get a normal result which is 144</p>

<p>However, if i changed</p>

<pre><code>int sum = 0;
</code></pre>

<p>to </p>

<pre><code>int sum;
</code></pre>

<p>I got a crazy result like 19557555002</p>

<p>So i was wondering what is happening in the second case?</p>

<p>Thanks for your answer :)</p>
