I have seen codes with using namespace std;
. Does it mean that if we use this then we don't have to include header files in the code or if we don't use namespaces, does it mean that we have to use std::
before every function, class?
You have to include header files and use namespaces.
The namespaces are contained in the header files, io streams like cin
,cout
are contained in the namespaces
.So, only if you include the header file, namespace can be used. Without using namespace std
, You have to use scope resolution operator every time you use those functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With