Hey guys, I have a pretty simple question, regarding why my program is not working... I know this is a REALLY easy program, I'm just tired and messing around with code to practice, and I'm totally stuck on something really simple...
#include <iostream>
usingnamespace std;
void choice1();
int main()
{
int choice;
char quit;
do
{
cout << "Welcome to Kyle's Math Program!" << endl;
cout << "This program will answer basic math questions"<< endl;
cout << "Such as Adding/Subracting/Multiplying/Dividing two numbers" << endl;
cout << "Press 1 to insert an Addition question" << endl;
cout << "Press 2 to insert a Subtraction question" << endl;
cout << "Press 3 to insert a Multiplication question" << endl;
cout << "Press 4 to insert a division question" << endl;
if(choice==1)
{
choice1();
}
cout<<"Do you want to continue (Y/N)?";
cin>>quit;
}
while(quit=='y'||quit=='Y');
}
void choice1()
{
int a = 1;
int b = 1;
int solution;
cout << "Alright, lets do some Addition!" << endl;
cout << "Enter the first number" << endl;
cin >> a >> endl;
cout << "Alright, now enter what you wish to add to that" << endl;
cin >> b >> endl;
a + b = solution;
cout << "Those two numbers added together is equal to" << solution << endl;
}
On line 39 I get a compiling error stating
main.cpp|39|error: no match for 'operator>>' in 'std::cin.std::basic_istream<_CharT, _Traits>::operator>> [with _CharT = char, _Traits = std::char_traits<char>](((int&)(& b))) >> std::endl'|
Could someone please help me point out my problem? So I can gain my sanity and possibly fall asleep tonight knowing I accomplished my mission?