I just started today with C++, watched a couple tutorials and read up on some information on the internet. My problem is that I am trying to make it so that i can enter
1
+
6
in my clalculator but the line of code giving me the most problems is
if (Calculation == + )
result = num1 + num2;
else if (Calculation == - )
result = num1 - num2;
else if (Calculation == * )
result = num1 * num2;
else if (Calculation == / )
result = num1 / num2;
I know i have to somehow tell the computer that the pluss in (Calculation == + ) is not to add, but instead a symbol that the user enters. How do I define this.
Try putting your operators in single quotes. If you would post your whole program it would make it easier for us to help you. Also, please use code tags. Press the <> button under format and paste your code in the tabs that appear.
Thank you that fixed it.
Below is my code I'm working on I'm trying to learn by doing this by myself untill i can't possibly get any further. Then I might ask again.