Jump to content

using namespace std;

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
hetra

hetra

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 297 posts
Hello all,

My C++ For Dummies book is an invaluable tool to me as I learn, but some of the things in there I don't understand. One of them is this line of code in every program:

using namespace std;

It is after library declarations...E.g.

#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

#2
CommittedC0der

CommittedC0der

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,565 posts
"using namespace std;" includes sirten files that lets us call any function in the std namespace(the namespace std; files) without having to prefix it so "std::cout" can now be written "cout". Does this answer your question?
A man can be defined by what he does when no one is looking.
Science is only an educated theory, which we cannot disprove.

#3
hetra

hetra

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 297 posts
Thanks that does.