where is standard namespace?

This is a discussion on where is standard namespace? within the C++ Programming forums, part of the General Programming Boards category; Hi, In the context of using namespace std; where is the location of the standard namespace. I know that when ...

  1. #1
    Registered User Mark S.'s Avatar
    Join Date
    May 2005
    Location
    England
    Posts
    16

    where is standard namespace?

    Hi,

    In the context of

    using namespace std;

    where is the location of the standard namespace.

    I know that when you use #include<iostream>
    the iostream is stored inside the VC98\Include folder.

    Can the standard namespace be located in those kind of terms.

    Any related information appreciated
    Thanks

    Mark S.

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,068
    Do you know what a namespace is? A namespace is a scope wrapper that you can put around your code to distinguish it from other variables with the same identifier. It looks like:
    Code:
    namespace foo {
    // My foo code
    }
    All standard library classes and functions are placed inside of the standard namespace. Thus you can either qualify all instances of identifiers from the libraries with std:: or you could do as you showed and use the using directive.
    Sent from my iPad®

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,412
    The standard namespace (or std) wraps the whole of the standard library facilities. It is thus spread through several libraries (consequently files).
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bug in iterator comparison in C++ standard?
    By steev in forum C++ Programming
    Replies: 14
    Last Post: 07-12-2008, 12:02 AM
  2. Replies: 8
    Last Post: 03-08-2008, 07:50 PM
  3. Standard C++ API
    By sparks in forum C++ Programming
    Replies: 9
    Last Post: 08-26-2005, 05:35 PM
  4. need ; before using namespace std
    By wwfarch in forum C++ Programming
    Replies: 7
    Last Post: 05-11-2004, 10:42 PM
  5. im extreamly new help
    By rigo305 in forum C++ Programming
    Replies: 27
    Last Post: 04-23-2004, 11:22 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21