Education for ALL
Pages
C
C++
MP
NM
CG
COA
CN
DBMS
Crypto
IP
SE
SPM
DSA
OS
MC
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
Newer Post
Older Post
Home
No comments:
Post a Comment