U
utab
Dear all, I posted this yesterday since it was a sunday, many people
missed it I guess and I could not find the answer.
I tried sth easy(actually this was an exercise) but I tried to use the
standard lib. heavily for this problem(as far as I can). There was one
point I could not figure out. The problem is :
../a.out 1.3+3.2+.1+40/3*8/7-4*5-32
The program will parse the argument and find the result of the above
expression. I have two versions(the 2nd is working , not perfect ;-}),
but the first have a return problem I guess because if I use that
version I get "nan" as the result at line 37. What is my problem?
Sorry that there are some comments and cout statement in around the
code. But I guess it could be easier to figure out.
You can find the two versions of the code here:
http://groups.google.be/group/comp.lang.c++/browse_thread/thread/
7ac73062c56a73a2/074abc747f2964e5?hl=en#074abc747f2964e5
One gentle poster commented on that UNIX may be expanding '*' to
wildcards, I tried that it is not the problem. I quoted and supplied
the expression. Probably I am missing sth quite easy.
missed it I guess and I could not find the answer.
I tried sth easy(actually this was an exercise) but I tried to use the
standard lib. heavily for this problem(as far as I can). There was one
point I could not figure out. The problem is :
../a.out 1.3+3.2+.1+40/3*8/7-4*5-32
The program will parse the argument and find the result of the above
expression. I have two versions(the 2nd is working , not perfect ;-}),
but the first have a return problem I guess because if I use that
version I get "nan" as the result at line 37. What is my problem?
Sorry that there are some comments and cout statement in around the
code. But I guess it could be easier to figure out.
You can find the two versions of the code here:
http://groups.google.be/group/comp.lang.c++/browse_thread/thread/
7ac73062c56a73a2/074abc747f2964e5?hl=en#074abc747f2964e5
One gentle poster commented on that UNIX may be expanding '*' to
wildcards, I tried that it is not the problem. I quoted and supplied
the expression. Probably I am missing sth quite easy.