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");
}
|