Value assigned to variable differs from value printed directly
<p>In a part of my code, I have</p>

<pre><code>a = cache[k1][k2][k3][k4];
cout &lt;&lt; "DEBUG: " &lt;&lt; a &lt;&lt; " " &lt;&lt; cache[k1][k2][k3][k4] &lt;&lt; endl;
</code></pre>

<p>And my cout has the following output:</p>

<pre><code>DEBUG: 38 38
DEBUG: 3 3
DEBUG: 37 37
DEBUG: 4 35 &lt;- the problem
</code></pre>

<p>I don't understand what in the world is going on.</p>

<p>a,k1,k2,k3,k4 are integers and cache is a </p>

<pre><code>vector&lt;vector&lt;vector&lt;vector&lt;int&gt; &gt; &gt; &gt;
</code></pre>
