You are declaring the message in the local scope of another function . Because you are returning a pointer, the program returns a pointer to a memory location, and not the string itself. When the function goes out of scope, the pointer becomes invalid.
Try returning a const char* instead of just a char*