use of using namespace std;

can anybody tell me,what is the use of writing namespace std;
so many c++ programs includes this line.plz tell me what is this and why it is needed.
Actually, it's usually a better idea NOT to use using namespace std;. Namespaces are to prevent redefinition errors, as is explained here:
http://cplusplus.com/doc/tutorial/namespaces/

When you're not calling stuff from any other namespaces, it saves typing.

-Albatross

Topic archived. No new replies allowed.