0
What is the use of namespace std? Can it be replaced by another code??
2 Respostas
+ 1
namespaces are not libraries.. in a namespace you define the explicit name of properties and methods in order to use it in a short hand way... it's no madatory to use the std namespace in your programs, but if you don't then you need to use the explicit call with the :: operator for each property and method of the standard library that you import and call in your program.
For example if you include the iostream library, part of the standard C++ library, but don't use the std namespace, then you will need to write std::cout to output to the standard stream.
0
namespace std is a standard library in c++ which allows u to import the things required for ur program and if u dont include it u will be resulting in an error