cin.clear(); cin.ignore(100, ' '); //100 --> asks cin to discard 100 characters from the input stream.