Why do you need a character array in the first place? The string class should meet all your needs.

If for some reason you really do need a C style string, there is a version of getline that works for those.