Ending a program.

I'm putting myself to the challenge of designing a Tic-Tac-Toe (Or, noughts and crosses) game and even adding in some AI.

I want to clear the screen after the user inputs a char (I'm using system('cls') because I can't find any other way to do it), but I'm not quite sure how to.

Here's what I stupidly did:

1
2
3
4
5
6
7
char f;
cin >> f;

if(f == 'f')
{
  break;
}


Now, the "break" only works with a loop, so I had to come to you for advise on how to achieve my goal.

tl;dr:
It's not that long. Read it.

EDIT:
I fixed it with the while(); loop.
Sorry for wasting your time.
Last edited on
Topic archived. No new replies allowed.