Thursday, June 25, 2009

Namespaces can be declared



NOTE : -
THIS CONTENT IS NOT ORIGINAL

9. Namespaces can be declared

Namespaces can be declared. The variables declared within a namespace can be used thanks to the :: operator:


using namespace std;
#include
#include

namespace first
{
int a;
int b;
}

namespace second
{
double a;
double b;
}

int main ()
{
first::a = 2;
first::b = 5;

second::a = 6.453;
second::b = 4.1e4;

cout << first::a + second::a << endl;
cout << first::b + second::b << endl;

return 0;
}


Output
8.453
41005





BIBILOGRAPHY / REFERENCE : - http://www.4p8.com/eric.brasseur/cppcen.html

No comments:

3G S

JAIL BREAK

iPHONE

BILL GATES

StEvE JoBs

steve jobs

STEVE JOBS

Steve Jobs

Love Country

SD

Burroughs

Lift

Joseph Johnson

Apple Rainbow

Apple Blue

Apple Laser Printer