return char array

Assuming that your code was anywhere near correct, there is no point in having a function return a global variable. Variables are defined as global so that there is no need to pass them or to return them.

If a function IS to return a local array, then the function must return a pointer to that array. The array must then be protected from going out of scope (by using the static keyword).