char* myfunc() { //-- It's important to allocate the string dynamically char* mystring = malloc(100); // do something with mystring return mystring; }