IT Community - Software Programming, Web Development and Technical Support

what is name space?

This is a discussion on what is name space? within the C and C++ Programming forums, part of the Software Development category; hi, what is namespace,wt necessary implement namespace in C++ Thanks, Prasath.K...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-17-2007, 05:40 AM
prasath prasath is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: Chennai
Posts: 173
prasath is on a distinguished road
Default what is name space?

hi,
what is namespace,wt necessary implement namespace in C++

Thanks,
Prasath.K
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-03-2007, 03:18 AM
vijayanand vijayanand is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 293
vijayanand is on a distinguished road
Default Re: what is name space?

Namespaces
Namespaces allow to group entities like classes, objects and functions under a name. This way the global scope can be divided in "sub-scopes", each one with its own name.

The format of namespaces is:
namespace identifier
{
entities
}

The example is:

// namespaces
#include <iostream>
using namespace std;

namespace first
{
int var = 5;
}

namespace second
{
double var = 3.1416;
}

int main () {
cout << first::var << endl;
cout << second::var << endl;
return 0;
}
__________________

J.Vijayanand
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database space-saving functions available in php vigneshgets PHP Programming 1 01-18-2008 04:20 AM
Why is there extra space before or after my table? oxygen HTML, CSS and Javascript Coding Techniques 1 07-27-2007 03:40 AM
web space jeyaprakash.c Web Design Help 3 05-22-2007 08:35 PM
Comment Space for Site nhoj Web Design Help 7 05-01-2007 06:32 AM
Perl: Disk Space pranky Perl 0 02-24-2007 01:07 AM


All times are GMT -7. The time now is 05:24 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0