title: C return character array from function
body: <p>I've searched and found dozens of solutions to returning a character array from a function, but none of them works. I'm sure this must be viable in C.
  Basicly, this is what I want to do.</p>
  
  <pre><code>char* Add( )
  {
      char *returnValue = (char *) malloc( sizeof(char) * 3 );
      returnValue = "test"; //This doesn't work. I'm not at all interrested in doing returnValue[0] = 't', returnValue[1] = 'e', etc.
      return returnValue;
  }
  </code></pre>
  
  <p>I hope you understand what I want to do here.</p>