Why namespace std is used...?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why namespace std is used...??

25th Oct 2018, 11:43 AM
aryan verma
aryan verma - avatar
4 Answers
+ 4
If you are reference by the line using namespace std; is really simple look this example below std::cout << "Why use std" << std::endl; This is what you need to type to print without namespace std. With namespace std. this happens cout << "Why use namepace std" << endl; In most simple and non formal way it's like you are giving a nickname to make code more readeble.
25th Oct 2018, 12:04 PM
Anya
Anya - avatar
0
Can you show code where it is used? Or explain your question more detailed please. By the way, you can lear more about namespaces.
25th Oct 2018, 11:52 AM
Dmytro
0
So you can avoid this... std::cout std::cin std::string Lots more,you could omit it if you want..
25th Oct 2018, 12:00 PM
Mensch
Mensch - avatar
0
easier for students to keep up with a lesson taught. but it is considered a bad practice using it for bigger programs. btw, 'using namespace' is just a way to shorten your code.
25th Oct 2018, 12:01 PM
Kuyondo
Kuyondo - avatar