is it imp to use using namespace plz reply | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

is it imp to use using namespace plz reply

3rd Oct 2016, 5:23 PM
Manisha Patil
Manisha Patil - avatar
3 Answers
+ 4
If you don't put "using namespace std;", you have to precise the namespace any time you use something from the standard library, like std::cout.
3rd Oct 2016, 5:25 PM
Zen
Zen - avatar
0
plz explain me briefly....
3rd Oct 2016, 5:30 PM
Manisha Patil
Manisha Patil - avatar
0
Without using namespace std; when you write for example cout <<; you'd have to put std::cout <<; ------------------------------------------------------------------------ #include <iostream> int main() { std::cout << "Hello World"; system("pause"); return 0; } --------------------------------------------------------------------------- #include <iostream> using namespace std; int main() { cout << "Hello World"; system("pause"); return 0; }
3rd Oct 2016, 5:47 PM
Thameshwar Sinha
Thameshwar Sinha - avatar