So I have a polynomial that looks like this: -4x^0 + x^1 + 4x^3 - 3x^4 I can tokenize this by space and \'+\' into: -4x^0, x^1, 4x^3, -, 3x^4
How could I just get t
scan the string for an 'x', then go backward storing each character of the coefficient until you hit white space. eg:
for (int i=0; i=0 && s[j]!=' '; --j) c = s[j] + c; cout << "coefficient: " << c << endl; } }