The lines can look like:
2 : 2 5 5 8
2 = 2 * 2
show 2
I already have a part working where the char colon contains ':' and poly and location are integers
if (iss >> poly >> colon)
{
location = poly;
while(iss >> coeff >> exp)
{
//do something
}
}
So this correctly extracts the information from a line in the form of the first line from my example lines.
In the following example, show is declared as a string containing "show" but it does not work.
Expand|Select|Wrap|Line Numbers
- if(iss >> show >> poly)
- {
- locationOfPoly = poly;
- cout <<"Poly[" << locationOfPoly << "] = " << Poly[locationOfPoly] << "\n";
- }