Thanks for the answer. But my question is: why do we need this in the first place. Since we exposed iostream, why can't we just use cout.
Why use std :: cout or use the std namespace?
If you are not using the std namespace, the compiler will try to call cout or cin, as if it were not defined in the namespace. Since it does not exist there, the compiler tries to name something that does not exist! Therefore, an error occurs.
source share