I'm using cout to print lots of lines. But i want to put together them in one variable etc. Then , i want to print it.
I think i can do it with ostream but I cant do it . Is there anybody to give me an example use of ostream.

I want to use it such that:
x<< "hello" << endl;
x<< "mike" << endl;
x<< "how " << endl;
x<< "are" << endl;
x<< "you" << endl;

cout << x;
will print

hello
mike
how
are
you

How can i do it?
Thanks in advance