Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Stamf

Ignore, sorry

This topic is 5630 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!