Unfortunately, no. You can't return arrays (of chars or of anything) directly as a return value. You can return a pointer, which works as long as you can guarantee that the object will remain in scope. For example, this will work
Code:
typedef char Name[MAX_LENGTH + 1];
Name names[10];
char *getName(int i) {
return names[i];
}
But this will not, because the array will have gone out of scope after the function returns.
Code:
char *getName(int i) {
Name name;
return name;
}
It is syntactically valid but you'd probably get segmentation faults when running it. Your array-returning syntax will be a syntax error, though. Have you tried it?