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.
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;
}
I hope you understand what I want to do here.