Hii ,
I am relatively new to programming C++ . I do know that the functions cout , cin etc… are defined in the standard name space . But we also include iostream header file for running the program .
So , is it like
namespace std
{
declaration of cout
declaration of cin
..... some other declarations etc....
}
and theior actual implementations inside istream and ostream … ????
Or , is it the other way round …??? like ….
namespace std
{
complete definition of cout
complete definition of cin
.........
}
and their signatures are just placed in the iostream file like …
iostream file
{
std :: cout
std :: cin
.....
}
Please provide any examples or links that you might think will help me understand better
These are not really functions, but global instances of
basic_ostreamandbasic_istream.You rather include headers so you can compile your source (the compiler needs to declarations etc).
The rest of the question is rather fuzzy. How the standard library is implemented is pretty much up to the implementation. The standard requires that if you include
iostream, you will get the declarations of the following globals: