I'm having trouble using strings to display the result,
it says: no match for operator - in arg1 - arg2. Anyone has a clue?
(I can't use doubles or integers as when a character is pressed, the program rage-loops, I want it to to keep looping until a decent argument is entered for the calculation)
Also I want to know how can I assign a for loop here so I can give the user 3 tries until it prompts it to go back to the menu or leave (code not included for that)
I don't think you can add strings like this.
What is the pupose of the following statement?
int resultadd = arg1 + arg2; // it is wrong because you haven't initialized arg1 and arg2
To carry out string arithmetic you will have to make your own functions and treat strings as arrays of characters. Also note that the value of character '0' is not 0 but 48 in decimal notation.
That's just a placeholder for something I tried haven't removed it yet.
What I need is the string inputs to be printed out as I can't use floaters/integers as the moment a character is pressed the program goes rage-loop.
You missed my post while you were typing. There is a way to make sure they have to enter a valid number; there's no need to mess around with numbers inside of strings.
Thank you L B, I haven't learned about these std:: statements or whatever they are. Just trying to make things work with what I know
I'm at chapter 6 in Jumpingintoc++: Functions and haven't seen that yet, I'll give it a shot.
Could you give a little explanation of how these std:: things work and will I see those in the book?