//************************************************************************** // function to clear the data from the cin stream up to and including the // next new line character. //************************************************************************** void clrStream() { while (cin.peek() != '\n') cin.ignore(); cin.ignore(); // ignore the newline as well }