RPN incorrect output

This is a discussion on RPN incorrect output within the C Programming forums, part of the General Programming Boards category; Sorry about that, the title is incorrect. I fixed the conflicting type. Hi everyone, the following code compiles correctly, but ...

RPN incorrect output

Sorry about that, the title is incorrect. I fixed the conflicting type. Hi everyone, the following code compiles correctly, but does not give the results it should. i.e. 30 5 - 7* should give me 175. Not even coming close can anyone help?

Troubleshooting is a critical skill, so learn it well. In this case, check each of the case statements operations, for accuracy, one by one.

You never want to try and troubleshoot a whole program. Verify each function as you code it up, for accuracy, as well as syntax. When you have a lot of code, lots of functions, and errors, it's a quick ride on the "Dante's Express", to the lower (and hotter) realms.

That's how I would have to debug your program, and i will decline that honor, so you can practice your new troubleshooting methodology skills! Nobody knows your program better than you do.

Troubleshooting is a critical skill, so learn it well. In this case, check each of the case statements operations, for accuracy, one by one.

You never want to try and troubleshoot a whole program. Verify each function as you code it up, for accuracy, as well as syntax. When you have a lot of code, lots of functions, and errors, it's a quick ride on the "Dante's Express", to the lower (and hotter) realms.

Agreement. Troubleshooting skills are actually more important than programming skills. C isn't a big language and it's not all that hard to learn (at least the basics). What takes real skill is figuring out what went wrong and, believe me, things do go wrong.

In my own experience, I spend about 25% of my time writing code, about 50% testing code and the rest is spent scratching my head over why it's not doing what I expected.

I once wrote a 200 line function that decoded and translated Midi files. The thing worked first time... I nearly fainted.