User Tools

Site Tools


cplusplus:selection_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cplusplus:selection_examples [2013/02/11 00:55] – [comparing characters] mithatcplusplus:selection_examples [2013/02/11 01:00] (current) – [switch] mithat
Line 138: Line 138:
     int selection;     int selection;
  
 +    // Prompt the user for a selection:
     cout << "Enter:" << endl     cout << "Enter:" << endl
          << "1 for a foo" << endl          << "1 for a foo" << endl
Line 145: Line 146:
     cin >> selection;     cin >> selection;
  
 +    // Give the user what they asked for:
     switch (selection)     switch (selection)
     {     {
Line 162: Line 164:
         cout << "You did not enter 1, 2, or 3." << endl;         cout << "You did not enter 1, 2, or 3." << endl;
     }     }
 +
     return 0;     return 0;
 }</file> }</file>
  
  
cplusplus/selection_examples.1360544149.txt.gz · Last modified: 2013/02/11 00:55 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki