C++ mathematic problem

Hi, everybody
So im writting a program that will solve lim functions...(nothing crazy)
My problem is how can I make into my cin command to take the whole mathematic function..eg(give me your lim function---> cin after and the users writes the function..then I check if there is a sqrt or a divition or anything like this..
I really need some help here..if someone didnt understand it just ask me..I really need help.. >_<
You want to parse math expression. It is not an easy task. Here is example of algorithm using stacks to parse arithmetic expressions: http://www.smccd.net/accounts/hasson/C++2Notes/ArithmeticParsing.html
If you want to add even more complex functions you might need to build an AST: http://en.wikipedia.org/wiki/Abstract_syntax_tree
http://stackoverflow.com/questions/1721553/how-to-construct-an-abstract-syntax-tree

Or you can use one of the existing parsers: https://www.google.ru/search?q=math+expression+parser+c%2B%2B
In addition, you want to take the limit, which means dealing with very small numbers. Since computers can't represent all real numbers exactly, you're likely to run into round-off errors if you aren't careful.
Topic archived. No new replies allowed.