Now i'd like to use isPunct to separate an expression when an operator(in this case punctuation is detected). I want to use istringstream, but I'm still baffled on how to use it.
In the end, I'd like a vector the contains the substrings such as
[0] 3x^3
[1] +2x-1
[2] -x
When the user inputs: 3x^3 +2x-1 -x
1 2 3 4 5 6 7 8 9 10 11
void separatePolynomial(string expr) {
string result;
vector<string> terms;
// remove spaces
remove_copy_if(expr.begin(), expr.end(), back_inserter(result), // store output
ptr_fun<int, int>(&isspace));
// separate tokens using operators
// code here
}