I'm having a problem with my "basic-calculator". The idea of the program is, that the user types in two numbers, and the program multiplies, divies, subtracts and adds them together. When the program does the operations and outputs them, I want the program to begin again - I want it to repeat itself until the user inputs an arranged word like "exit" or smth. I tried with strings and do "while", but my knowledge of C++ is verry poor for now, so I want you to help me please.
Why not use goto? It's only dangerous when there is the risk of an infinite loop...
And I don't see how a while or a do...while loop can be used here...
It make's code less maintainable before it doesn't have normal scope blocks like a while/do loop. It's generally discouraged in the professional community because it's very difficult to follow the applications flow when goto's are being used.
edit:
1 2 3 4 5 6 7 8 9 10 11
string sinput = "";
cout << "please enter equation: ";
cin >> sinput;
while (sinput != "exit") {
cout << "please enter equation: ";
cin >> sinput;
}