In article <4ef093fe$0$3059$>,
d
says...
> Victor Bazarov <> wrote:
> > ... and it could also be a hidden loop if one uses the first value to
> > initialize a vector, and then uses std::copy to read the following
> > values into the vector, from its 'begin()' to its 'end()'... My $0.02.
>
> It actually may be simpler to just write the loop explicitly. The
> advantage is that you are not limited to C++ streams.
>
You guys are beyond me this time. 8<{{
My application here is a small part of a large legacy project I'm
trying to upgrade to use modern C++ & STL constructs - from simple C
code I wrote 20+ years ago. This particular code parses elements of a
parameter data file. At the "head" of the logic, I read text file
strings, determine what type of record is being processed, and use a
switch/case statement to work with the remaining record type data. I
have already read the record am passing a string containing the variable
data in the record to be processed. This is but 1 of 65+ record types
being handled in the code.
Thus, I don't see how I can "(re)read" the elements of the string
data...and the sscanfs were the only way I knew to do it years ago.
Paul's technique works nicely (now that I understand it), but your
and Victor's discussions have me totally confused. 8<}}