Original Post
Hi,
Can anyone please enlighten me how on to load ALL the contents from a (file)stream object directly to a string object.
I tried all sorts of way and the only one I found is the stream.read function but it outputs to an array rather than a string object (which defeats the purpose that I''m trying to avoid char arrays)
Thanks..
istream if;
string str;
char buf[128];
//..
if.get(buf, sizeof(buf)); // want to place the contents straight to str
|