My C++ calculator
Hey guys. I am using c++ to make a calculator, I am pretty much done. I have 4 cases and if the user tries another case other than 1, 2, 3, or 4, I want a string to be looped. However I cannot find a looping tutorial I can link to this. It would look something like this: if case 1…. if case 2.. if case 3.. if case 4.. else loop opt Im stuck on loops. Could anyone be of help please?
I want to make this a loop: cout << opt; cin >> a;
Hey what do ya know, I did it.
I don't understand what you're trying to do… Why would you want to loop a string if they're wrong? Couldn't you just display the option menu? Or are you looping the menu? Because that would be dumb.
Anyways, just look up the syntax for a C++ loop. Should be simple enough. Or you could just post what you're trying. That would make it easier to troubleshoot.