bakermunch
Programmer
hello,
i am writing a windows based calculator and i want to make it as close to windows calc as possible. so farr i have it working on an if-else statement on the equals button. This detects which operator i(m_cOperator) pressed and returns a value to the screen. On the operator buttons, the variable is set too '+' or whichever op it is. The only problem is i cant do multiple additions without pressing equals everytime.
Also, i need to be able to do bracketed sums,but have no idea how too. At the moment, I have a button for each digit which converts a string into a double usin atof to enable calculations.
Can any body suggest a way for me to do these things,help would be most appreciated
regards
bakermunch
i am writing a windows based calculator and i want to make it as close to windows calc as possible. so farr i have it working on an if-else statement on the equals button. This detects which operator i(m_cOperator) pressed and returns a value to the screen. On the operator buttons, the variable is set too '+' or whichever op it is. The only problem is i cant do multiple additions without pressing equals everytime.
Also, i need to be able to do bracketed sums,but have no idea how too. At the moment, I have a button for each digit which converts a string into a double usin atof to enable calculations.
Can any body suggest a way for me to do these things,help would be most appreciated
regards
bakermunch