I'm working on a Tic Tac Toe project for school that's due today and I'm writing notes for a Tic Tac Toe game my friend and I worked on together. Except I don't understand what the cin.ignore and cin.get part of it means/does.
1 2 3 4 5 6
{
cout << "Invalid Move" << endl << "Press Enter To Try Again"; //if none of chosen options available becomes Invalid Move
player++; //adds 1 to player to make sure it doesn't switch turns if player types in an invalid move
cin.ignore(); //ignores wrong input
cin.get(); //keeps the cout up until user intputs character
}
Both are waiting for the user input (it ends when the user hits enter) then read the input in that case ignore() reads one character and get() as well.