2

I'm fairly new to C++ so I hope this question isn't dumb, plus I've searched around and couldn't find an answer.

So this brings my to my question, is there any difference in loading times between calling std::cout and calling cout when using namespace std is added to the code? I imagine that if there is a difference it should be unnoticeable, but I'd like to be sure before turning in my project.

By the way, in my university we are told that using namespace std is okay (I've already read at lengths on that and whether it is good practice or not is not in question right now).

Eleyson
  • 33
  • 3
  • I feel a less flippant answer than David gave can be found at http://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice – Jeff.Clark Jun 18 '15 at 21:45
  • 2
    _"By the way, in my university we are told that using namespace std"_ - You should transfer to another school. – Captain Obvlious Jun 18 '15 at 22:12
  • You should use `using namespace` with caution, prefer listing each symbol, such as `using std::cout; using std::cin; using std::endl;`. – Thomas Matthews Jun 18 '15 at 22:30

1 Answers1

2

There is no difference. And performance should be the last of your concerns when making these kinds of "micro" code decisions.

David Schwartz
  • 179,497
  • 17
  • 214
  • 278
  • It's not about performance of the program but more curiosity, I didn't express myself as well as I should have. Thanks! – Eleyson Jun 18 '15 at 21:45