|
| Grey Wolf (1407) | |||
| Please don't take this the wrong way, but the code is a bit of a mess. I can't follow it properly without spending a lot of time on it. TrigSqrt() is never called. you need to include cmath..
I would sugest that you try restructuring your code. Sorry. | |||
Last edited on | |||
| ogranatw (19) | |||
I rewrote some of it to begin again, but it doesn't work, I'm not that god at this really.
| |||
| Grey Wolf (1407) | |||||
| Here is some code put together from Stroustrups book, compare it to your previous code. The Grammar for the language accepted by this calculator is
When you have your head around that, look at modifying the grammar to incorporate sin, cos... that should help you get you calls to the relevant functions in the right place. Hope this helps.
| |||||
Last edited on | |||||
| ogranatw (19) | |
| Thank you very much, do you think you could add some commentaries please, so I know what I'm doing. | |
| Grey Wolf (1407) | |
| I have started putting coments in the code above. Keep an eye on it, I'll try to do more soon. Feel free to ask questions. | |
| ogranatw (19) | |
| And if you have time, could you add some pseudocode, it would be nice of you, and helpful for me :) Thanks for your help | |
| Grey Wolf (1407) | |
| It is basically a "Recursive descent parser", if you Google it you will probably find better explanations of it than I have time to do. I will try to finish commenting it in the next few days though. | |
Pages: [1] [2]
This topic is archived - New replies not allowed.
