Ignore, sorry

Started by
2 comments, last by Stamf 21 years, 3 months ago
Never mind people, just let this die. Thank you lol Thanks mate, I got it a second before you replied lol [edited by - Stamf on January 19, 2003 11:14:03 PM]
Advertisement
Try including <iostream> instead.
"...."
You are running into a common problem which has to do with the history of C/C++.

Here is the OLD C++ way to do things (before the standard)


      // c header file#include <stdlib.h>// c++ header file#include <iostream.h>// non-c++ headers#include <windows.h>int main(void)  {  cout << "hello world" << endl; // no namespace used  }  



here is the new (standard) c++ way to do things



        // c header file, no .h and add c prefix#include <cstdlib>// C++ standard headers have no .h#include <iostream>// non-c++ headers, no change#include <windows.h>int main(void)  {  std::cout << "hello world" << std::endl;  }    


so in C++ all C / C++ standard header files do not have a .h suffix anymore, and their contents are now in namespace std. Of course you can use the using clause

using namespace std;

I just figured my example was better showing what was in the namespace.

[edited by - Xai on January 19, 2003 11:18:12 PM]

[edited by - Xai on January 19, 2003 11:19:02 PM]
can i just say ... DON''T DO THAT ...

NEVER EVER EVER go delete the original question from a post. First of all, because someone else may be having the same problem ... but how are they gonna find the answer?

If you had left the question alone, and ADDED a new response saying you got it ... then others who did a search on "namespace std" would have found your problem and the solution ... now they probably won''t

This topic is closed to new replies.

Advertisement