- Joined
- Nov 6, 2002
- Messages
- 2,978
- Reaction score
- 191
- Trophies
- 2
- Age
- 41
- Website
- www.elrinth.com
- XP
- 1,344
- Country

Code:
#include <iostream> // contains cout and cin
#include <string> // contains string
#include <conio.h> // contains getch
using namespace std; // let's use not need to type std:: before all standard libarary stuff
int main( int argc, char* argv[] ) { // the standard console main looks like this
string myInput = "";
while ( myInput != "1" ) {
cout << "Please enter something:";
cin >> myInput; // the program will pause here and wait for input until it gets a return-key press then it will continue
if ( myInput == "1" ) {
cout << "You typed the number 1, congratulations, now the program will close after you press ANY key on your keyboard which is connecter to the computer you are using right now.";
getch(); // just take a keyboard input and then continue with the program.
}
else {
cout << "Wrong input! You could try typing 1 instead for great success! ;)\r\n";
}
}
return 0;
}







