HHH wrote:
Can someone tell me why does my c++ program always close straight away when
i open it. For example, i had made a build version of my first program
"Hello World", and when i tried it, it opened and closed. Is there a code i
have to right or something?
Unless your program prompts the user for input (hint!!!)
or delays, the operating system is allowed to terminate it
after its execution.
In some windowing operating systems, a new window is opened
for an application. As soon as the application is finished,
the window closes. In these scenarios, most programmers
employ a "press any key" prompt for the user.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq:
http://www.parashift.com/c++-faq-lite
C Faq:
http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book