reading input without knowing datatype
i am supposed to read an input line (no termination condition is given hence i assume it to be '\n')
Now the input contains of
operands - int
operators - char
and i am to calculate the expression
eg : 2 + 4
note : i have used gets to read the whole line and store it in a char variable
then in a loop i read each char from it using sscanf to process it
but the problem is the terminating condition (the loop goes infinite if i use '\n' or '\0' )
i have also tried concat of the string in char with a specific char like # and then check for it but it does not work !
how do i do this ?