How to tell the program to end in C++?

I have an if statement and if the statement is true, I want the program to end. Please keep in mind, I'm using XCode, so some stuff might not work.

ex:
1
2
3
4
5
6
int main()
{
     int x=1;   
     if(x=1)
         ______________
}

The blank is where I want the program to end.
Last edited on
The program will end automatically when the main function ends so no need to to do anything in this case.
I know that, but if there was more code at the end, how would I end the program there.
return 0;
Topic archived. No new replies allowed.