In where we really use this expression "using namespace std ; " in c++ ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

In where we really use this expression "using namespace std ; " in c++ ?

When we do programme in c++ we use the expression using namespace std . Which includes c++ standard library but in the code where we really use those features . And what wrong will happen if we don't write the expression " using namespace std ; " ? please give example for that . I couldn't get much by reading the lesson provided by sololearn ๐Ÿ˜ž about that expression (using namespace std ; ) . What that expression really does ? ๐Ÿ˜•

12th Sep 2018, 5:56 AM
Atik๐Ÿ‡ง๐Ÿ‡ฉ
Atik๐Ÿ‡ง๐Ÿ‡ฉ - avatar
1 Answer
+ 2
it imports everything from the std namespace making it so you don't have to write "std::string" or "std::cout" but rather "string" and "cout". in most small codes no problems will occur, but when you start dealing with multiple namespaces, clashing can occur.
12th Sep 2018, 9:09 AM
hinanawi
hinanawi - avatar