title: Returning a char* in C
body: <p>Got any ideas why this code doesn't work?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  char* get_name()
  {
      char string[4];
  
      string[0] = 'A';
      string[1] = 'N';
      string[2] = 'A';
      string[3] = '\0';
  
      return string;
  }
  
  
  int main()
  {
      char *name = get_name();
  
          printf("%s \n", name);
  
          return 0;
  }
  </code></pre>
  
  <p>Thank you.</p>