Superwormy
Golden Member
What I ultimately want to do is this:
int Coefficient;
int Exponent;
cout << "Enter the polynomial: ";
while (cin >> Coefficient >> Exponent)
; // do something
So normally, 'cin' knows they are seperate variables by whitespace inbetween, so it'd be find if I did this:
3 2
But what I want to do is this:
3x^2
And have it still understand that 3 is the Coefficient and 2 is the Exponent. Basically treat the x^ as whitespace...
...how?
int Coefficient;
int Exponent;
cout << "Enter the polynomial: ";
while (cin >> Coefficient >> Exponent)
; // do something
So normally, 'cin' knows they are seperate variables by whitespace inbetween, so it'd be find if I did this:
3 2
But what I want to do is this:
3x^2
And have it still understand that 3 is the Coefficient and 2 is the Exponent. Basically treat the x^ as whitespace...
...how?