Check out example codes for "how to remove maximum number of characters in c++ cin,ignore". It will help you in understanding the concepts better.

Code Example 1

std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

Learn ReactJs, React Native from akashmittal.com