M
Mike Copeland
I am trying to use stringstreams to parse some complex data. In the
code below, myTest is a string that contains int (9), char ('M'),
string ("45-49") and
string (" Male Age Group 45-49") data fields, and I can't get the
code to work. Perhaps there's an option to set or function to call, but
I'm lost here. Please advise. TIA
stringstream sss;
string myTest = "9 M45-49 Male Age Group 45-49 ";
string s1, s2;
int i1;
char c1;
sss.str(myTest);
sss >> i1 >> c1 >> setw(5) >> s1 >> setw(40) >> s2;
code below, myTest is a string that contains int (9), char ('M'),
string ("45-49") and
string (" Male Age Group 45-49") data fields, and I can't get the
code to work. Perhaps there's an option to set or function to call, but
I'm lost here. Please advise. TIA
stringstream sss;
string myTest = "9 M45-49 Male Age Group 45-49 ";
string s1, s2;
int i1;
char c1;
sss.str(myTest);
sss >> i1 >> c1 >> setw(5) >> s1 >> setw(40) >> s2;