Hi guys!
So I need help with a small problem. I'm using a char pointer array which contains a mathematical expression.
For example: "sqrt 25"
Now I want to use the inbuild c++ function sqrt(int))
. I'm first searching in the array for the letters 'sqrt' so that my custom function knows what to math function to call. As the example is only a small part of a long math expression. Now I'm running through a while-loop intill it finds a whitespace. So that I know where the number stops.
while(Expression[i] != '')
Dont know should I read the number into another int array?Which creates new problems.The idea is that I want to use the 25 as a whole number and not 2 and 5 seperately because that will give an incorrect answer.
Is there another way of doing this? There must be a simpler way...I think I just forgot about something
Any help will be appreciated :)
Thanks!