hi, im brand new to programming with c++ and i ran into a problem. whenever i execute a program, the command prompt either pops up and disapears in an instant, or it closes whenever i press the enter key... is there anyway to solve this??
This is a very common problem. A search will get you lots of answers.
My favorite solution is to add cin.get() as the last line of the main program (but before any return statement). If you are doing user input in your program, you might need to ignore a newline entered by the user, so add this:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.