Thread: namespaces

  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    24

    namespaces

    What would prompt an error telling me that "std is not recognized as a namespace, blah blah blah..." while attempting to use 'std::string'? Obviously std is a namespace, so that error seems rather absurd to me.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    You aren't including the proper header, so the compiler can't find the std namespace!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    24
    Ah... thanks. I guess I overlooked it since it normally tells me "unreferenced identifier" when I forget to include the header. Stupid me!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. namespaces or static classes ?? you decide
    By Hussain Hani in forum C++ Programming
    Replies: 9
    Last Post: 07-11-2009, 11:20 AM
  2. need help wiht using classes...namespaces...
    By hockey97 in forum C++ Programming
    Replies: 9
    Last Post: 09-02-2008, 02:22 PM
  3. C and namespaces
    By oyse in forum C Programming
    Replies: 2
    Last Post: 05-05-2004, 09:39 AM
  4. namespaces and friends
    By okinrus in forum C++ Programming
    Replies: 1
    Last Post: 03-27-2004, 08:47 AM
  5. custom namespaces
    By uvacow in forum C# Programming
    Replies: 2
    Last Post: 03-16-2004, 02:53 PM