|
-
Sep 22nd, 2008, 10:18 AM
#1
Thread Starter
Lively Member
closing console window after user inputs number
Hi Folks,
Here is the code I've been trying to use in VC++ 6.0:
#include <iostream.h>
void main() {
cout << "Test" << endl;
int number;
cin >> number;
if (number == 0)
system("exit");
}
I want the console window to close automatically if the user inputs 0. So far, the application stops and "press any key to continue" appears after inputting 0. Any clues to what I'm doing wrong?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|