Explains,namespaces
Quick Search for:  in language:    
Explains,namespaces
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
C/ C++ Stats

 Code: 451,578 lines
 Jobs: 605 postings

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for C/ C++.
Visual Pi Hex
By jo122321323 on 8/25


Click here to see a screenshot of this code!ShortCutSample
By Massimiliano Tomassetti on 8/25

(Screen Shot)

AnPMoneyManager beta
By Anthony Tristan on 8/24


A calculator (english/polish )
By Tom Dziedzic on 8/24


MMC (Mouse Move Counter)
By Laszlo Hegedüs on 8/24


Text-DB
By Jerome A. Simon on 8/24


JDos
By Jerome A. Simon on 8/23


Game 1945X
By Ozgun Harmanci on 8/23


Find hidden "back streamed" files on NTFS partitions. This code is a must for sec consultants.
By Israel B. Bentch on 8/22


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Namespace tutorial .

Print
Email
 

Submitted on: 5/26/2002 5:18:43 PM
By: Jared Bruni  
Level: Intermediate
User Rating: By 11 Users
Compatibility:C++ (general), Microsoft Visual C++, Borland C++, UNIX C++

Users have accessed this article 961 times.
 

(About the author)
 
     Explains namespaces.

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
Namespace tutorial

A namespace groups together variables, functions, and classes. It is a mechanizim, for expressing logical grouping. For example, the functions for a string library, could be placed in a namespace called string.

    namespace string {
    void strcpy(char* source, char* from);
    void strcat(char* source, char* from);
    int strlen(char* source);
}

void string::strcpy(char* source, char* from) { }
void string::strcat(char* source, char* from) { }
int string::strlen(char* source) { return (0); }


A namespace can contain functions, variables,
and classes. When you wish to use
a namespace you can use the statement,
using namespace name; to allow the
aspects of that namespace to be accessed
without specificly specifying there namespace.


Other 273 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Intermediate category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
5/27/2002 12:33:51 PM:Merlin Corey
Heh, I did something simalar... Your tutorial is cut off - it seems to end at "A namespace can contain functions, variables, and cla"...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/27/2002 12:34:51 PM:Merlin Corey
*similar* ;)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/27/2002 5:53:05 PM:Jared Bruni
ok *fixed* it
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/27/2002 6:48:59 PM:Jimmy Murphy
hey you seem to know alot and be good at C++...how much money do you make a year?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/27/2002 8:20:53 PM:David Fritts
Jared, got aim? Message me if you do or go download it then message me: Nulled0x00 is my s/n i got some questions to ask you ;p
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/27/2002 9:49:29 PM:Jared Bruni
my screen name is xmasterxx3 on aim
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/28/2002 12:53:09 AM:TRON
Nice article, I've learned something from this at least =)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/21/2002 2:19:36 AM:Alok Gupta
good work sir pls eamil me,u are great,and talking to great people is cooll
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | C/ C++ Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.