I have a problem with a calculator

Hey.
I have created a simple calculator in C++, using Qt creator. It's a GUI calculator. My problem is, when I click more than one time on one of the arithmetic operators, the result will get back to 0.It works fine, Except for clicking more than one time on the operators like (+, -, *, /).
How do I solve it.
closed account (48T7M4Gy)
Which one of the operators do you click on that gives you 0 result? What are the values you input? This sounds like you're starting of with a number and performing repeated division etc. Either that or you are doing integer division eg 1 / 3 gives zero as the result if you're reading the values as integers.
My calculator works good except for clicking more than one time on + or - or * etc. button.
If I type, for example 5*7 I get 35, no problem with that, but if I type 5 and then double click or more than one click on * operator and then type 7, I get 0 result.
closed account (48T7M4Gy)
You will need to examine the underlying code because there are numerous possibilities including how the GUI is made up eg two text boxes, a result text box and a series of operator buttons all with different code. Could be something to do with text change functionality.
Thanks. I'll try to spend some time to practice and fix it.
Topic archived. No new replies allowed.