First of all, if you want to use strings i reccomend the string class.
first and second strings are declared as arrays of 5 chars. while your function return char*.
change the first and seconds string into char* xxx;

You should create your own string class, or use the one from Standard C++. It isn't good to use char*