Hi everyone. I'm new to the forum and thought it would be a good idea to come to the experts with some of my questions. I am currently trying to write a relatively simple program but being quite new to c++ i'm struggling with some things. I am trying to use a switch statement twice in my program. The user makes a selection and according to the switch statement it returns a given answer. But i then need to get the user to make another selection using the same switch statement. I can write the switch statment twice and it works fine but i have been informed i can use the same one twice. Any help with this would be greatly appreciated and if the technical speak could be kept to a minimum that would help too as i'm afraid my tiny brain cant cope :) Thanks everyone.
robski
0
Newbie Poster
Recommended Answers
Jump to PostNot quite sure what you mean, but maybe this will help you :
switch(option){ case 1 : doCase1(); break; case 2 : doCase2(); break; case 3 : case 4 : doCase3And4(); break; default : break; }
The idea is that if the user picks 3 or 4 …
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.