Thread: Variables
View Single Post
  #5 (permalink)  
Old 11-20-2007, 11:45 AM
MrPickle's Avatar
MrPickle MrPickle is offline
PT Admin
Join Date: Nov 2007
Location: England, Lincolnshire
Posts: 332
iTrader: (0)
MrPickle is a jewel in the roughMrPickle is a jewel in the roughMrPickle is a jewel in the rough
Thank you, I now have another question haha.

How would you go to a previous point?

Example:
Code:
//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?
    }
}

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
Reply With Quote