return char array

You are at least 100% correct. It don't work! Not like that anyway. Your Errors are too numerous to elaborate on. Since you don't give any specific error message, etc. there is also no question to answer. For any other newbies reading the thread, it always helps to specify (in a language that someone who has no knowledge of what you are trying to do) exactly what is, in your opinion going wrong and whatever suspicions you may have. Stating that it doesn't work is like taking your car to the mechanic and telling him it doesn't run. It may be more helpful to say that it won't start, is making noises, has no power, etc... Arduinos are no different.