Originally posted by AlbafaN
either return a pointer to char array
You can't return a pointer to char array. bcos the char array will go out of scope when the function returns.