ostream objects

Hi,
I have this code:

1
2
3
4
5
6
7
8
9
10
11
int main()
{
    stringstream out2;
    ostream& out = out2;


    out<<"Hello\n";

    cout<<out<<endl;
    return 0;
}


The cout views only a decimal number (an address?)
Why?
stream objects have a cast operator to void* ( used to test whether the stream is in a good state )
When you pass a stream object as right operand of << you'll see that address
There is a way to display the string?
ostreams are not meant to be read. If you want the string get it from the stringstream.
Ok, Thanks!
Topic archived. No new replies allowed.