In my project i need to take an expression input from user as string and then show the result of the expression. I am taking the input as follows
char address[100] = {NULL};
fgets(address, 100, stdin); //take the expression as input here
say user wrote the expression as
address = " 1+5+9" .
What i need to do is to show the result of the expression. I can do this by separating each number and then doing the calculation. But i just wanted to know is there any better way to do this?