0
For what purpose" using namespace std " is used?
4 Respostas
+ 1
namespace is similar to the workspace in real time...
you can use your tools without any objection or external commands ...
but to use tools from other workspace ...you have to get their permission...
similarly
in cpp all the input /output streams and most basic functionalities are given under the namespace "std".it is provided in #include<iostream>. "using" is a keyword which tells the compiler which namespace is being used .
if you don't use using namespace std... you should specify the compiler that the functions we use like cout,cin ,etc belong to std
std::cin,std::cout...etc.
you can even create your own namespaces...
like int main(or any other main) specify it as
namespace name...where name can be any legit string (or variable name).
you can define some functions inside it...
and use them with...
name::function()....
hope this helps...
0
thanks man..but the thing is i use turbo c++ in my pc and there i dont need to use this.why so?
0
it depends on the compiler ...
turbo c++ is so user-friendly that they have many things implicit...
0
if you want to learn coding in more basic level too...try using codeblocks with mingw compiler (inbuilt with gnu/gcc compiler)