

It has the additional advantage that, if the user enters unnecessary whitespace in front of the title, those will be ignored.

This will eat potential leading whitespaces, including the newline. Use the std::ws manipulator in the std::getline.It contains advanced features than C language. C++ is a high level, general purpose programming language developed by Bjarne Stroustrup at Bell Labs. The main difference between getline and cin is that getline is a standard library function in the string header file while cin is an instance of istream class.C++ uses library to provides various string functions like strcat, strlen, strcmp, strcpy, swap, and many more where strcat is used to concatenate string, strlen will calculate the length of the string, strcmp is used to compare two strings, strcpy will copy one value of the. String function are the functions that are used to perform operations on a string.
