Passing object of class 'ostream' by reference

We are passing ‘cout’ object by reference. And returning it by reference again. I did not get this. What is meant by returning by reference? Are we returning the address of ‘cout’? Please help me clear this concept.

ostream is a object
and if you pass it by reference that means your are passing the address of ostream object

you also have to return this because it will helpful in operator cascading
for example
cout<<a<<b;
(cout<<a) return cout so that it is used for b;

Yes

1 Like