title: Passing pointer to local variable to function: is it safe?
body: <p>For example:</p>
  
  <pre><code>void func1(){
      int i = 123;
      func2(&amp;i);
  }
  void func2(int *a){
      *a = 456;
  }
  </code></pre>
  
  <p>When <code>func1</code> calling <code>func2</code>, a pointer to local variable is passed to <code>func2</code> -- the pointer is pointed to the stack. Is this safe for the rules of C?</p>
  
  <p>Thanks.</p>