Function return-type Confusion

I am getting confused about the operator-overloading function of cout. Since function return class ostream object but in function its return type is ostream&. I have a confusion about (&) operator. Please anyone explain it.

hello @nikhil015
ostream class has protected constructors due to which we are not allowed to create any new object that is why u will always see & operator(by using this operator we pass same object instead of creating its copy) with ostream and istream class.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.