Window Closing

 

I am studying C++ along with MQL4 to help me better understand some concepts.  I downloaded a free editor and compiler for C++ and it works great.  Only one problem, when I run the program, the window closes before displaying the results of the program.  There is probably something simple I can do to avoid this, but perhaps someone can save me some time by telling what I need to do.  As you can see, I'm a newbie at this.  Thanks in advance.

Since I first posted this question, I did a search and found one way to do this, by using a system("PAUSE"); command just before return to the Main function, but if anyone knows of a better way, please respond.  Thanks.



 
guy65:

I am studying C++ along with MQL4 to help me better understand some concepts.  I downloaded a free editor and compiler for C++ and it works great.  Only one problem, when I run the program, the window closes before displaying the results of the program.  There is probably something simple I can do to avoid this, but perhaps someone can save me some time by telling what I need to do.  As you can see, I'm a newbie at this.  Thanks in advance.

Since I first posted this question, I did a search and found one way to do this, by using a system("PAUSE"); command just before return to the Main function, but if anyone knows of a better way, please respond.  Thanks.



Try a C++ forum.


Probably your window close AFTER displaying the results. Try to run your program from command line.

Reason: