Thread: Variables
View Single Post
  #11 (permalink)  
Old 11-20-2007, 12:31 PM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 616
iTrader: (0)
Lee is just really niceLee is just really niceLee is just really niceLee is just really nice
I am sorry but i have forgotten how to loop back, i will have to look it up if someone doesn't beat me too it, to stop the window closing use system("PAUSE"); make sure it is within you main section though, e.g:
Quote:
//that stuff (iostream and whatnot) don't know off the top of my head atm.

int main(){
int a,b;
string name;
cout
<< "Hello, What's your name? \n";
getline(cin,name);
cout
<< "Please enter a value" << name << ".\n";
getline(cin,a);
cout
<< "Please enter another value.";
getline(cin,b);
if(a == b){
cout
<< "a = b";
return 0;
} else {
cout
<< "Try again";
//Now it would go back to the second cout?
}

system("PAUSE");
}
Reply With Quote
The Following User Says Thank You to Lee For This Useful Post:
MrPickle (11-20-2007)