Console Closing
Ok, so I guess your using Windows. Well, the easiest way I suppose is to use getchar to wait for a key to be pressed; when the key is pressed the program exits. For example:
#include <stdio.h>int main(){ // Some code // Wait for some input from the keyboard getchar(); // Exit the program by closing the console return 0;
You could always inlude conio.h and put getch() at the end of your code
EDIT - Whoops. Looks like Floppy beat me too it. They both basically do the same thing. Have fun
Edited by - Big Sassy on January 29, 2002 1:09:24 AM
#include <conio.h>void main(){ // do stuff getch();}
EDIT - Whoops. Looks like Floppy beat me too it. They both basically do the same thing. Have fun
Edited by - Big Sassy on January 29, 2002 1:09:24 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement