0

Possible Duplicates:
What is namespace used for, in C++?
Why is 'using namespace std;' considered a bad practice in C++?

Before asking my question I wolud like to share the below link with everybody who is eager to know about stl or may be if he has not seen this[its a video lecture/tutorial]:

STL by Stephan T. Lavavej

I am a beginner on C++ STL and I found it very useful/entertaining as a learner. Stephan is a great teacher!!, but sorry if anywone disagrees with me or considers it a waste of time.

how are namespaces used in real time projects.I am asking this because while writing programs I usually use namepaces globally in the .cpp files like :

using namespace std;
int main()
{
//code
}

If its wrong way of declaring namespaces, how should we do it generally.

EDIT:

If we declare the namespace globally as above does it causes naming conflict or shall i declare it locally like.

int main()
{
using namespace std;
//code
}
Community
  • 1
  • 1
munish
  • 4,173
  • 13
  • 51
  • 77
  • 1
    possible duplicate of [What is namespace used for, in C++?](http://stackoverflow.com/questions/5333568/what-is-namespace-used-for-in-c) Also see [Why is 'using namespace std;' considered a bad practice in C++?](http://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-a-bad-practice-in-c) – In silico May 14 '11 at 06:27
  • See also http://stackoverflow.com/questions/1265039/using-std-namespace/1265109#1265109 – AProgrammer May 14 '11 at 06:34

0 Answers0