I think he wants to terminate the program together with the confirmation of winning if a player win.
Also I noticed that I can overwrite the previous move of the other player.
First, change void main()
to int main()
because void returns nothing.
Then, at the end, put
1 2 3 4 5 6 7
std::cout<<"you win!!"<<std::endl;
// don't forget to #include <limits> for this!
std::cout << "Press ENTER to end the program..." << endl;
std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' );
return 0;
You will, of course, have to change "you win" to "you lose" if you lost.