I've taken about a three or four months break from programming without even having an extremely good grasp on it in the first place, so I decided to write a really quick program to refresh my memory. The last thing I need is to be bogged down with unexplained errors.
This is the only error throughout my entire code, and I get it EVERY SINGLE TIME I use either the operators << or >> after using either cout or cin. I am using Dev-C++ 5
Code:#include <iostream> using namespace std; void addition(void); void subtraction(void); void menu(void); int main() { menu(); return 0; } void menu(void) { int menuselection; int quitselection; cout << "Please select from the list below:"; << endl; cout << "1. Addition"; <<endl; cout << "2. Subtraction"; <<endl; cin >> menuselection; switch (menuselection) { case 1: addition(); break; case 2: subtraction(); break; default: menu(); } cout << "Do you wish to continue or quit?" <<endl; cout << "1. Continue" <<endl; cout << "2. Quit" <<endl; cin >> quitselection; if (quitselection == 1) menu(); else return; } void addition(void) { float number1; float number2; cout << "Enter a number upon which you wish to add."; <<endl; cin >> number1; cout << "Enter a number to add to the previous number."; <<endl; cin >> number2; cout << number1+number2; <<endl; } void subtraction(void) { float number1; float number2; cout << "Enter a number from wish you wish to deduct." <<endl; cin >> number1; cout << "Enter a number to subtract from the previous number." <<endl; cin >> number2; cout << number1-number2; <<endl; }