title: Why does removing 'cout' from my function change its result?
body: <p>I am an intermediate programmer, writing a program that's probably much to complicated for me. The programs aim is to construct certain 2-d arrays, and has a few different class objects that are communicating with each other in a not-so-simple way. In order to debug, I added a line of code to output where I was in the program (cout &lt;&lt; "here";). The program now works, but if I remove the cout statement, the overall result of the entire program fails; the program does not follow the intended procedure to create the said 2-d arrays. </p>
  
  <p>So my question is: What could possibly be happening? or rather, how would including a cout statement "fix" (or have any kind of impact on) the other surrounding code?  It does not seem like a cout statement would have an impact on Buffer overflow, but feel free to educate me if so.</p>