Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

code problem

Status
Not open for further replies.

peter1211

Programmer
Apr 11, 2005
2
GB
Hi all, Im having problems with the following code,

It is a simple reverse polish calculator but it only seems to calculate the first two operands.

e.g,

$ ./program 6 6 +

will produce the answer 12

but so will,

$ ./program 6 6 6 +


many thanx.
 
You have 3 operands and 1 operator: it should be 3 operands and 2 operators i.e.
Code:
$./program 6 6 6 + +
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top