title: C static array pointer address
body: <p>We have a code.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int* aa(int s){
      static int ad[2] = {0};
      ad[0] = s;
      printf("aa() -&gt; %p\n", &amp;ad);
      return ad;
  }
  
  int main(void) {
      int *k = aa(3);
      printf("main() -&gt; %p\n", &amp;k);
      return 0;
  }
  </code></pre>
  
  <p>Compile, run..
  output</p>
  
  <pre><code>aa() -&gt; 0x80497d0
  main() -&gt; 0xbfbe3e0c
  </code></pre>
  
  <p>or i misunderstood or this code have problems.</p>
  
  <p>we are returning the same address for static array <code>ad</code> why on output they differ?</p>