1

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?

Destructor
  • 14,123
  • 11
  • 61
  • 126
Manoj Bharadwaj
  • 191
  • 1
  • 1
  • 10

1 Answers1

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