GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 10-Oct-2004, 22:56
BobbyMurcerFan BobbyMurcerFan is offline
Member
 
Join Date: May 2004
Posts: 103
BobbyMurcerFan is on a distinguished road

Where is namespace std Defined?


I realize one should type using namespace std underneath the C++ header files #include directives.

But where is namespace std actually defined? I've searched the C++ header files but have been unable to find namespace std defined anywhere.

Am I missing something? THANKS A LOT!
  #2  
Old 11-Oct-2004, 23:07
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light
Quote:
Originally Posted by BobbyMurcerFan
I realize one should type using namespace std underneath the C++ header files #include directives.

But where is namespace std actually defined? I've searched the C++ header files but have been unable to find namespace std defined anywhere.

Am I missing something? THANKS A LOT!

Hi Bobby. Both using and namespace are c++ keywords (reference). I am not an expert in C++, but I felt that this link explained the whole using namespace std thing quite well.

Hope this helps.
  #3  
Old 12-Oct-2004, 05:27
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 961
LuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the roughLuciWiz is a jewel in the rough
Hmm...
I didn't reply to this post because I thought the question was another one. I thought what he wanted to know was where, exactly in the headers was std defined.
You would expect somewhere in list.h or list (I would, actually )
This is actually what I would like to know. I mean, I know how to use and make my own namespaces, but where are the implicit ones defined?

Best regards,
Luci
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
  #4  
Old 12-Oct-2004, 07:47
dsmith's Avatar
dsmith dsmith is offline
Senior Member
 
Join Date: Jan 2004
Location: Utah, USA
Posts: 1,351
dsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of lightdsmith is a glorious beacon of light
Quote:
Originally Posted by LuciWiz
Hmm...
I didn't reply to this post because I thought the question was another one. I thought what he wanted to know was where, exactly in the headers was std defined.
You would expect somewhere in list.h or list (I would, actually )
This is actually what I would like to know. I mean, I know how to use and make my own namespaces, but where are the implicit ones defined?

Best regards,
Luci

I do believe you are correct Lucian. I didn't read the post right. I am not sure of the answer to where std is actually defined. If I find anything I will post back.

Sorry Bobby... my bad.
Last edited by dsmith : 12-Oct-2004 at 20:18.
  #5  
Old 12-Oct-2004, 17:12
BobbyMurcerFan BobbyMurcerFan is offline
Member
 
Join Date: May 2004
Posts: 103
BobbyMurcerFan is on a distinguished road
dsmith,

While Luci (thanks) is right about my ?, you provided some great info and links..

Thanks a lot to you both!
  #6  
Old 13-Oct-2004, 15:27
BobbyMurcerFan BobbyMurcerFan is offline
Member
 
Join Date: May 2004
Posts: 103
BobbyMurcerFan is on a distinguished road
Well, I found out that the GNU and MS Visual Studio versions of cstdio and stdio.h are very different.

In the GNU version, I can see where namespace std is defied, but in the MSVS version, I can't find the declaration.

Would have thought they would be the same, but I was obviously mistaken.

It still makes me wonder where namespace std is defied in Visual C++.
Attached Files
File Type: doc cstdio_GNU.doc (26.0 KB, 6 views)
File Type: doc stdio_GNU.doc (46.5 KB, 3 views)
File Type: doc CSTDIO_MSVC.doc (19.0 KB, 4 views)
File Type: doc STDIO_MSVC.doc (42.0 KB, 2 views)
 
 

Recent GIDBlogWriting a book by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LNK2005 Error: Already defined in... TekiFreek C++ Forum 11 05-Dec-2007 21:47
User defined data types Kareem1984 C Programming Language 1 06-Oct-2004 19:26
Get value for variable name defined as string mirizar C Programming Language 3 21-Jun-2004 18:36
Which Header Files to Use?? BobbyMurcerFan C++ Forum 8 16-Jun-2004 19:29
ClassView not showing my classes (VC++, namespace, headers) ?!?!? djovanov C++ Forum 1 13-Jan-2004 05:54

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 08:28.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.