Education for ALL
Pages
DL
MP
MC
COA
ES
NM
CG
OS
IP
DC
CN
CNS
Cryptography
C
C++
DSA
DBMS
SAD
SE
SPM
IoT
Blockchain
DS
AI
ML
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