C++ program to define Namespace

//include an variable within the namespace
//and use this variable in main() program

#include <iostream>
using namespace std;
namespace xyz
{
    int n=10;
}
int main()
{
    cout<<"The value of n is "<<xyz::n;
    return 0;
}

No comments:

Post a Comment