Are they in the namespace std? or in the header file ? I have heard that only contains the prototype of functions and not the definitions. Am I right?
Asked
Active
Viewed 97 times
1
-
6They aren't functions, they're objects. – chris Sep 28 '14 at 17:45
-
2Look for the C++ standard library source code. – zmbq Sep 28 '14 at 17:50
1 Answers
3
cout
and cin
(and cerr
as well) are namespace-scope objects (not functions) in namespace std
. They're declared in the header <iostream>
. Their definition is technically an implementation detail — in practice, it is most likely in the C++ runtime library.

Angew is no longer proud of SO
- 167,307
- 17
- 350
- 455