English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

how do you get the program you compile to stay up when you run it if it just flashes

2006-09-14 14:47:14 · 4 answers · asked by Anonymous in Computers & Internet Programming & Design

4 answers

you should type this after :
#include

and before u put ' }' in the last row of main function, type:
getch();

hope u got it! =)

2006-09-14 14:55:38 · answer #1 · answered by NaBiLa H 1 · 0 0

Assuming you are new to programming and it's a program you are compiling in windows.

You have type

system("pause");

before the "return (value). Otherwise the windows program will close it.

Cheers & Bottoms Up

2006-09-14 22:04:13 · answer #2 · answered by Bambang W 2 · 0 0

I guess, your program is console one, right?
You can make it stay onscreen either adding
getch();
or
while( !kbhit()) { ; }
at the end of your main() -- in this case it will wait for a keypress -- or simply executing it from command line (from console).

2006-09-14 21:52:59 · answer #3 · answered by alakit013 5 · 1 0

at the very end of your program (if using on a windows based OS) type
system("pause");

2006-09-14 21:55:41 · answer #4 · answered by D 4 · 0 0

fedest.com, questions and answers