character arrays that are created on the stack like iReturn[] can not be returned because they are destroyed as soon as the function returns.

You have two options

1) Have the calling function create the array and pass it to GetBase2() as a parameter, such as char* GetBase2(int iBase, int iNumber, char iReturn[]) . Note that the function return is char*, not just char

2: Make iReturn a pointer, allocate it with malloc(), return it like you tried to do. In this case, the calling function -- main() -- will have to free it when done with it. char *iReturn = malloc(64);