+ 2
What is "using namespace std" is doing?
what's is that doing in the program?
2 Antworten
+ 6
it's kind of a shortcut.
When you use some functions like "cout" or "cin" or when you declare a variable using "int, double, string ...." you should put "std::" in front of them.
Like "std::cout" or "std::cin". That namespace is helping you to write faster.
Or at least this is just one role.
+ 2
Things like cout, cin, string, etc are located in what's called a namespace (consider it a group). Their namespace is called std. Usually you access these operators by writing std::cout, std::string, etc.
With "using namespace std;" you can use them without having to write std:: everytime.