Could you please tell me what is the return type of "cout"?
Thanks in Advance.
Regards,
-Raman Chalotra
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
> Could you please tell me what is the return type of "cout"?
Functions have return types; "cout" is a std::ostream object, not a
function.
--
Dave Seaman
Oral Arguments in Mumia Abu-Jamal Case heard May 17
U.S. Court of Appeals, Third Circuit
<http://www.abu-jamal-news.com/>
> Could you please tell me what is the return type of "cout"?
If you mean the type of cout itself, then it's not a function, but a
global variable of type std::ostream. If you mean the type of
expression like (cout << 5), then it's std::ostream&, and the value is
a reference to cout itself, which is why you can chain operator<< on
it.
{ Edits: quoted signature & clc++m banner removed. Please don't quote
them. -mod }
It depends Are you referring to cout as an object (std::ostream) ? or
are you referring to "cout <<" which is the object + an overloaded
opeartor that in this case returns std::ostream&
--