"DerekBaker" <De***@DontBother.comwrote in message
news:fg**********@energise.enta.net...
>* Jim Langston:
>"DerekBaker" <De***@DontBother.comwrote in message
news:fg**********@energise.enta.net...
>>Why does this code only give Value = "Microsoft":
istringstream is(Dest);
is >Value;
where Value is a string& and Dest a char* holding "Microsoft Sans Serif"
As stated, operator<< for stream and std::string is deliminated by
whitespace. A space, end of line, etc...
If you want the entire line use getline.
std::getline( is, Value );
which is delimited by the end of line.
The function the code's in is templated for Value. I guess I'll have to
specialize the function for string.
Usually an arbitrary value is delimited by whitespace anyway, with some
exceptions.
I've found that for std::string sometimes I need one word, sometimes I need
the entire line, it depends on what I am specifically doing at the moment.
As soon as you specialize for std::string to get the entire line you'll find
that you now only need to get one one word.