I\'ve tried the following:
char[10] testfunc()
{
char[10] str;
return str;
}
a char array is returned by char*, but the function you wrote does not work because you are returning an automatic variable that disappear when the function exits. Use something like this:
char *testfunc() {
char* arr = malloc(100);
strcpy(arr,"xxxx");
return arr;
}
This of course if you are returning an array in the C sense, not an std:: or boost:: or something else. As noted in the comment section: remember to free the memory from the caller.