sath <sa**@discussions.microsoft.comwrote:
I need to parse a string which is like
ACS*PR*1*101.55**2*-22**66*166*68~
The data between the asterisks should go to sepate strings (string1, string2
etc)
Can I string instead of c-string?
Any help is appreciated.
If speed doesn't matter, you can put it into a
stringstream and read with 'std::getline()' using '*'
as the EOL char until you hit EDF. Or look into the
'std::string::find...()' family of functions and use
one of these together with 'std::string::substr()'.
Both ways avoid C-strings.
Thanks in advance.
HTH,
Schobi
--
Sp******@gmx.de is never read
I'm HSchober at gmx dot de
"If there were some arcane way to remove the heads of every
newsgroup troll on the planet, I think it would elevate
humans to a whole new level of intelligence."
Rocky Frisco