Wednesday, 4 September 2013

how can I convert istream * to string or just print it?

how can I convert istream * to string or just print it?

The below function part of connector/C++, it returns a istream*. if i just
try and print it, it shows hex or a memory location because its a * type.
istream *stream = res->getBlob(1);
I tried to read & print it with this:
string s;
while (getline(*stream, s))
cout << s << endl;
But this crashes with access violation though. any other way i can print
it or convert to string?

No comments:

Post a Comment