char *xyz() { char str[32]; strcpy(str,\"Hello there!\"); return(str); } void main() { printf(\"%s\",xyz()); }
When I call xyz(), is i
Yes, it is a dangling pointer. Your program invokes undefined behaviour.
On some systems it might crash your application, on others it might appear to work correctly. But either way, you should not do it.