Visual Studio c++ - program fails without debugger, works fine with debugger
<p>my program executes exactly as desired when i run the debugger even with no breakpoints</p>

<p>when i run without debugging, i get a debug error</p>

<blockquote>
  <p>"This application has requested the Runtime to terminate it in an unusual way."</p>
</blockquote>

<p>At one point, I call a function that sets a variable called <code>currCode</code> (an integer)</p>

<pre><code>currCode = function();
//this throws debug error
</code></pre>

<p>If i add a cout of the variable <code>currCode</code> between this line and the next line, the program works fine with or without the debugger. </p>

<pre><code>currCode = function();
cout &lt;&lt; currCode; //this works!
</code></pre>
