std::istream::ignore(i.e. cin.ignore()) the first argument is the number of characters to be discarded. The value '\n'has an ASCII code of 10, so it is '\n'implicitly converted to an integer (most likely 10, but may differ when using different encoding - EBCDIC uses 21) and that the characters are ignored, leaving a few remaining.
, :
#include <limits> //for numeric_limtis
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');