I think I could be wrong though, otherwise:
Code:
const char * blah(void)
{
return "haha";
}
Wouldn't be right either. Perhaps someone smarter than us will come along
---------------
> So I tried to apply it to strings.
You could pass a pointer to a character array which you could then fill with the string...
Code:
void peasoup(char * str, size_t n)
{
if(str == NULL)
return;
memset(str, 0, n);
strncpy(str, "Pea soup!", n - 1);
return;
}
/* ... */
char something[32];
peasoup(something, sizeof(something));