using namespace std;
I have no idea what the importance of the above is.
Thanks
using namespace std;
I have no idea what the importance of the above is.
Thanks
don't know for sure either... but someone [i think davidp] told me that it was for correct function recognition when functions have preceding underscores...
hasafraggin shizigishin oppashigger...
the std namespace is the namespace which the entire Standard c++ libarary is declared. So when you use namespace std you simplify access to the standard library. I also herd it deals with clashes between old and new header files.
arrh, i got nothing good to say.
http://www.praxis1.vic.edu.au/home/dcola/
A namespace is a piece of code that is encapsulated within a pair of brackets, just like any other class.
Example:
namespace a
{
int AAA;
};
namespace b
{
int BFunc( int x )
{
return x;
}
}
int main()
{
AAA = 5; // error: unknown identifier AAA
a::AAA = 5; // ok
BFunc( AAA ); // error: unknown identifiers: AAA and BFunc
b::BFunc( a::AAA ); // ok
return 0;
}
The using directive means you try to use this prefix automatically:
using namespace a;
int main()
{
AAA = 5; // ok, a:: added automatically
a::AAA = 5; // ok
BFunc( AAA ); // error: unknown identifier BFunc
b::BFunc( a::AAA ); // ok
return 0;
}
All functions in the C++ headers belong to namespace std.
So you can either use this in front of all your functions, or
set it once.
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.