-1
How to read an operand composed of 2 or more characters, in the code I created I go through all the string
in order to identify each type of operation and number, only that I am traversing this particular vector and treating each position as a character(char
) the part. Therefore, when entering with the value 10, it would not be treated as a number but as 2 characters, in this case 1 and 0.
Follows the code: https://onlinegdb.com/ByCh64VHH
What I can do to display this type of operand ?
P.S.: I don’t want to perform any operation, just display it!
First in C the assignment of a string is not done with the = operator but with the strcpy function of <string. h> (e.g.: res = "SUM";). To identify numbers with multiple digits you have to analyze their input and identify and separate the tokens, remembering that a number can be an integer or a real and the notation can be normal or scientific, with each digit read transform the number by adding this digit to the right.
– anonimo
If you do not need the corresponding numeric value just copy each digit to a string and when there are no more digits add the terminator ' 0', taking into account the possible notations used.
– anonimo