?
2011-02-21 18:10:07 UTC
// REQ: str is a non-empty, NULL-terminated string,
// n is less than or equal to the length of str
// EFF: Reverses first n characters of str, returning the result
char result[n+1];
char* ptr = result;
for (int i = n; i > 0; i--)
*ptr++ = str[i];
result[n] = '\0';
return result;
}
The compiler gives me this error: 27: warning: address of local variable âresultâ returned
What's wrong?