converting string to int
Posted on 2004-04-28
hello. I have a string that represents the coefficients of an equation. i need to parse this and eventually convert each coefficient to it's integer or float equivalent.
"8 6 -6/7 +22/16 "
means 8 = 6(x1) -6/7(x2) +22/16(x3)
i'm thinking of using strtok( ) to get each of the coefficients separately, but then what do i do next? i tried to cast the string to an integer, but that doesn't work. please help. thank you. i'm sorry i can't offer that many points for this, it's b/c i'm a new user.