![]() |
my console apps just close...system("pause") doesnt work
whenever i open one of my simple console apps, and theres a prompt, if i input, right after the comp outputs (be4 i can even see it) it instantaneously closes (unless running in debug mode, im talkin about just opening the .exe)
i added system("pause"); and it compiled :) but didnt work :(...it still closed instantaneously after inputing a value |
Assuming you're using VS, it will close anyways in debug mode. It's when you run it in non-debug mode (but still from the IDE) that it stays open. Maybe post your code?
|
It might be executing a runtime error. Something that the compiler doesn't pick up, because it's conditional upon what happens inside the execution.
|
system("pause") only works in Windows. You could try using cin.get(). Those are the only standard methods I know.
|
Try this
:
system("PAUSE");also make sure that system is all lower case ( i don't know if that matters but it might help). |
You need to post your code, it is probably not getting to the system call.
|
heres my code then dark:
:
/***************** |
You don't notice anything wrong with where return 0; is located? And please use a switch() statement.
|
Your problem is that system("pause") comes after you return. Put it before that.
:
else goto Cont;:
Prompt:And use some indentation. |
lol yeah gotta get in habit of indentation, read my comments my first revision is to get rid of gotos, already deleted cont and continue cause they did nothing lol....duno how to loop (syntax) but ill learn, i know the comcept pretty well from VB
adding prm function got me an error |
| All times are GMT -5. The time now is 8:05 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC