What is Namespace?

sunveer

Member
Joined
7 Apr 2011
Messages
246
Reaction score
7
Namespace is basically a group of classes, objects or functions that are given one name.

So to use any predefined class or function in your program, you first have to include the appropriate namespace in your program to use that class or function.
 
Sunveer ur a programmer? In C++,ie u'r using TC to compile u dnt nee namespace,but for visual studio compiler,u hav to mention "using namespace std"
 
Yes arsh he is a engineering student. :)

Arsh25 said:
Sunveer ur a programmer? In C++,ie u'r using TC to compile u dnt nee namespace,but for visual studio compiler,u hav to mention "using namespace std"
 
Using namespace is according to the latest ANSI standards.

TC is an old compiler. Avoid using it.
 
Example of using namespace in C++

#include iostream.h (sorry if i use < >, i whole iostream is missing here)
using namespace std;
{
cout<<"Hello";
}

output : Hello
 
Try in Turbo C compiler in windows or on any Linux Platform.... with the sample program....
 
Back
Top Bottom
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock