The easy way is to use getline(cin,name) where name is a std::string. If, for some reason the first 49 characters are the only ones that are significant you can use resize(). If you must make life difficult for yourself
The first version is simpler, but doesn't give you a chance to perform any extra processing if the line was too long for your buffer. With the second you have a chance to react to the excessive input in a more constructive manner.
// Leave newline in stream, regardless of
// success, then use ignore to discard
// any extra(plus the newline).
// Check the status of failbit, if true discard
// any characters in the buffer up to and
// including newline