title: error: function returns address of local variable
body: <p>I'm beginner with C and I am learning on my own. 
  I am creating the following function:</p>
  
  <pre><code>char *foo(int x){
       if(x &lt; 0){
          char a[1000];
          char b = "blah";
          x = x - 1;
          char *c = foo(x);
          strcpy(a, b);
          strcat(a, c);
          return a;
        }
      blah ...
  }
  </code></pre>
  
  <p>I am basically trying to return an appended string, but I get the following error:</p>
  
  <p>"error: function returns address of local variable", any suggestions, how to fix this?</p>