Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int choice = 10;
- while(choice != 0)
- {
- cout<<"välj alternativ";
- cin>>choice;
- cin.ignore(); // Empty the buffer
- switch(choice)
- case 0:
- cout<<"tack för att du körde programmet!";
- break;
- case 1:
- doSomething();
- break;
- case 2:
- doSomethingElse();
- break;
- default:
- cout<<"Ogiltigt val, försök igen";
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement