+ 1

What is "using namespace std" in c++

13th Apr 2017, 7:28 PM
Aytac
Aytac - avatar
2 Answers
+ 7
C++ std  is the standard namespace where features of the C++ Standard Library, such as string or vector or int are declared. So by saying "using namespace std" you are instructing the c++ compiler where to find the constructs defined in the header files you include (eg: iostream) If you don't write it, when the compiler sees string or vector or int it will not know what you are referring to and you will get a compile error.
13th Apr 2017, 7:39 PM
Shraddha
Shraddha - avatar