title: Returning a local variable confusion in C
body: <p>Recently I read a thread on stackoverflow that returning a local variable must be avoided whether its a pointer type or a normal variable. I saw an example in my C book and it was returning a local variable, so I thought to try it again</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int func(int a, int b)
  {
      int d, e, f;
      d = a;
      e = b;
      f = d+e;
      return f;
  }
  int main(void)
  {
      int c = func(1, 2);
      printf("hello\n");//I put this printf in between
      printf("c = %d\n", c);//here c should be overwritten
      return 0;
  }
  </code></pre>
  
  <p>In that thread it was said, that if I put anything between function call and accessing that variable, I will miss the value. </p>
  
  <p>I am able to access the local variable whatever I do, yet I recall I wrote an example according to that thread and was showing same behaviour as told.</p>
  
  <p>What am I missing?</p>