title: printf changes the value
body: <p>Consider this little code</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  void* foo1(double bar)
  {
      double s2 = 0.5;
      double s1 = bar/s2;
      double toreturn[2] = {s1,s2};
      printf("Outside main. Second value: %f\n", toreturn[1]); //this line is commented out for the second output. See below text
      return toreturn;
  }
  
  
  int main()
  {
      void* (*foo)(double) = NULL;
      foo = &amp;foo1;
      double bar = 2.12;
  
      double* resp = foo(bar);
      printf("In main. First value: %f\n", resp[0]);
      printf("In main. Second value: %f\n", resp[1]);
      return 0;
  }
  </code></pre>
  
  <p>The code outputs </p>
  
  <pre><code>Outside main. Second value: 0.500000
  In main. First value: 4.240000
  In main. Second value: 0.500000
  </code></pre>
  
  <p>, which is what I expected. However, if I comment out the the print instruction (the one within the definition of <code>foo1</code>), I get this output:</p>
  
  <pre><code>In main. First value: 4.240000
  In main. Second value: 0.000000
  </code></pre>
  
  <p>, which makes no sense to me! It seems weird to me that a <code>printf</code> command can change the values of the variables. Can you explain please explain me this behavior?</p>