just finished my program but now when i run only the executable as soon as i enter the filename and hit enter, the exe closes. any ideas what i need to do?
just finished my program but now when i run only the executable as soon as i enter the filename and hit enter, the exe closes. any ideas what i need to do?
When no one helps you out. Call google();
That's an extremely common problem. There are a few ways you can fix that problem:Originally Posted by InvariantLoop
One is cin.get(), which is included in the <iostream.h> file, and another solution you can use <stdlib.h> and use system("pause"). Just call one of those functions right before you return from main.
Last edited by Krak; 01-29-2005 at 02:50 PM.
how do u pause? give me an example, i put it in my code as follows
and still no go,Code:return 1; system ("pause");
When no one helps you out. Call google();
You need to put the pause before the return statement. And also, you should always return 0 if there wasn't an error.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Try swapping those two statements around.
No use pausing AFTER you return.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
yep it works now. thanks again ehehe
When no one helps you out. Call google();