Look up getline, I don't know for sure why. Getline is low-level manipulation of characters in the stream and its behavior is less predictable than formatted >>. http://www.cplusplus.com/reference/iostream/istream/getline/
And I'd advise you to use std::string rather than char[].