www.digitalmars.com         C & C++   DMDScript  

c++.stl - STL Not in namespace std ???

reply greertr <greertr embarqmail.com> writes:
Why does this compile properly and when I uncomment the "using
namespace std;", it doesn't.  This seems wierd and nunsettling to
me. LMAO

#include <iostream.h>
//using namespace std;  //Unbelievable DM's SGISTL33 isn't in the
namespace standard!
int main(int argc, char* argv[])
{
	cout << "Hello world!\n";
	return 0;
}
Jul 06 2008
parent Heinz Saathoff <newshsaat arcor.de> writes:
Hello,

greertr wrote...
 Why does this compile properly and when I uncomment the "using
 namespace std;", it doesn't.  This seems wierd and nunsettling to
 me. LMAO
 
 #include <iostream.h>
 //using namespace std;  //Unbelievable DM's SGISTL33 isn't in the
 namespace standard!
 int main(int argc, char* argv[])
 {
 	cout << "Hello world!\n";
 	return 0;
 }
The header files named xxx.h are old and don't use namespace. They should only be used for old code. Use the header <iostrem> instead. Include the stlport path somewhere so that the compiler will find the header. The command line to compile the file would be dmc -Ic:\dm\stlport\stlport example.cpp - Heinz
Aug 06 2008