I need to write a function in C language which recieves an input as a string using the function gets.the input shuold consist of numbers (double) and the following actions:+,-.^,*,/ and brackets.The program should calculate the expression. the maximum length of the exspresion should be 195 chars.the program should calculate the expresion in the brackets at first, than the ^ and afterwards the / and * and at last the + and -.We assume that when we use the action ^ the second operand is an integer.
In addition, I can use only the libary <stdio.h> and the libary <string.h> and only the basic functions,arrays,loops and conditions.
I need to write this part of my program until monday and if I'll get a grade which is under 40 I will faill the course and would'nt be able to do the exam.
Therefore, I need some help as soon as possible. my idea was to get the input as a string which I defined as char and than divided it into 2 strings, one was double and contained the numbers and the second was char and contained the operators and brackets. however, I failed to do so.
any help would help me a lot.In addition, it would be great if someone could write me the code which divides the input string into the new two strings because I believe that I would be able to finish the exercise from this point.
In addition, I can use only the libary <stdio.h> and the libary <string.h> and only the basic functions,arrays,loops and conditions.
I need to write this part of my program until monday and if I'll get a grade which is under 40 I will faill the course and would'nt be able to do the exam.
Therefore, I need some help as soon as possible. my idea was to get the input as a string which I defined as char and than divided it into 2 strings, one was double and contained the numbers and the second was char and contained the operators and brackets. however, I failed to do so.
any help would help me a lot.In addition, it would be great if someone could write me the code which divides the input string into the new two strings because I believe that I would be able to finish the exercise from this point.