reading from a string copying to a char