How to keep my c++ program open until closing manually ?

I'm just wanna know how to keep my C++ program open until i press close button(x).
I mean if i write a simple program like printing Hello World and make an exe so the program would immediately close after writing that.
so suggest a code to keep it open until i close button.
closed account (1vRz3TCk)
carefully read: http://www.cplusplus.com/forum/beginner/1988/
Place
 
system ("PAUSE");

In the last line of your main. This will fix that.
@ Golden0907: You obviously need to read CodeMonkey's link too. Using system() is bad advice.
Using system() is bad advice
that's true..

however it's ok for homework testing or "hello world" testing and I'm shore that Mr. threadstarter want to do exactly this :D
closed account (1vRz3TCk)
unless he is using a Mac or Linux...


The most important thing is to understand what is going on...
Topic archived. No new replies allowed.