Newbie: help me please!!!

This is a discussion on Newbie: help me please!!! within the C++ Programming forums, part of the General Programming Boards category; Now that I've figured out how to maintain an open DOS window with cin.get, whenever I run my program and ...

Newbie: help me please!!!

Now that I've figured out how to maintain an open DOS window with cin.get, whenever I run my program and press ENTER, the window automatically closes? Does anyone know why this is and how to fix it? T|-|4|\||< j00!

thats overkill for a simple app. heres (a better explanation than i can give) why.

i've seen several people use system("PAUSE") when they want to delay their programs. i'm not sure who's teaching this method, but it's a bad habit.
by calling system(), you are invoking the default shell. the shell then executes the commandline given to it ("PAUSE", in this case). that is, it runs the 'pause.exe' program. so, now your simple c program is relying on two external programs for a stupid thing like pressing a single key. what if someone deleted or renamed 'pause.exe'? what if someone tried to compile your program on unix, or a mac? it wouldn't work. you'd get an annoying shell message and no pause. besides, why have the overhead of launching 2 programs, when you can accomplish the same thing in c?