हिंदी माध्यम नोट्स
Class 6
Hindi social science science maths English
Class 7
Hindi social science science maths English
Class 8
Hindi social science science maths English
Class 9
Hindi social science science Maths English
Class 10
Hindi Social science science Maths English
Class 11
Hindi sociology physics physical education maths english economics geography History
chemistry business studies biology accountancy political science
Class 12
Hindi physics physical education maths english economics
chemistry business studies biology accountancy Political science History sociology
English medium Notes
Class 6
Hindi social science science maths English
Class 7
Hindi social science science maths English
Class 8
Hindi social science science maths English
Class 9
Hindi social science science Maths English
Class 10
Hindi Social science science Maths English
Class 11
Hindi physics physical education maths entrepreneurship english economics
chemistry business studies biology accountancy
Class 12
Hindi physics physical education maths entrepreneurship english economics
chemistry business studies biology accountancy
namespace in c++ language in hindi , what is name space in c language with source code program
c++ language मे name से variable , function , structure , enum , class और class member को define करता है | जब कोई programmer बड़े प्रोग्राम को design करता है तब name मे confusion हो सकता है | जब किसी class को दो या दो से अधिक source से use किया जा सकता अहि उसमे भी name मे consion हो सकता है | उदहारण के लिए , दो library को define किया जाता जिसमे class को declare किया जाता है इसका name add , sub और node | जब किसी प्रोग्राम मे पहली libarary मे से class add को use करना है और दुसरे library मे से class sub को use करना होता है और दोनों function मे node c;अस अलग लगा होता अहि तब name मे confusion होता है | इस प्रॉब्लम को name space प्रॉब्लम कहते है |
name space in c language
c++ language के name space को discuss करने से पहले namespace को discuss करेगे |
किसिस प्रोग्राम मे declarative region को जरुर देखा होगा | declarative region एस region होता है जिसमे declartion किया जाता है | उदाहरन के लिए global variable को main() function से बहार declare किया जाता है | इसका decalretive region main() function बहार होता होता है लेकिन local variable नको main() function के अंदर declare किया जाता है | इसके लिए main() की body decalretive region होता है |
इसका उदहारण होता है :
#include<iostream.h>
#include<conio.h>
int c;
void main()
{
int a,b;
cout<<“Enter Input : “;
cin>>a>>b;
c= a+b;
cout<<“Output :”<<c;
getch();
}
इस उदहारण मे , a और b local variable है इसे main() मे declare किया जाता है | और c global variable होता है इसे main() के बहार declare किया जाता है |
scope भी किसी variable का important property है | scope का मतलब होता है variable का effectiveness | अतः इसका मतलब है जब तब variable की active होता है | scope जब से variable को declare किया जाता है से लेकर variable को terminate तक होता है | scope , decalretive region से लाग होता अहि | उदहारण के लिए global variable के लिए scope पुरे प्रोग्राम होता है लेकिन local variable केवल main() होता अहि | या जिस function की body मे declare किया जाता है इसका scope केवल इस function मे होता है |
variable , scope के अन्दर भी active नहीं रहता है उदहारण के लिए किसी दुसरे variable को declare किया जाता है जिसका name किसी दुसरे variable से सामान होता है तब दुसरे variable की active ness को हाईड करा सकता है | local variable को global variable के असिपे को change किया जा सकता है | लेकिन दोनों variable का नाम सामान होता है |
नीचे दिए गये डायग्राम मे decalretive region, scope को बताया है |
Namespace in c++
c++ मे namespace को create किया जा सकता है | इसके लिए decalretive region के नए रूप को declare किया जाता है | decalretive region के नए रूप का मतलब है की variable को declare करने के लिए नए space को allocate करना | किस decalretive region के name , कसी दुसरे decalretive region के name से fusion नहीं होता है | और इसके अलावा namespace मे declare की गयी variable और function को इसे करने के लिए methodology को use किया जाता है |
उदाहरन के लिए :
namespace jack {
double poail ; // variable declare
void fetch(); // Funciotn declare
int pal; // variable declare
struct well {….}; // struture declare
}
namespace jill {
double bucket (double n ){……..} // Funciotn declare
void fetch; // variable declare
int pal; // variable declare
struct hill {….}; // struture declare
}
namespace को global level और किसी namespace के अन्दर declare किया जा सकता है | लेकिन इन namespace को block मे declare नहीं किया जा सकता है | name space मे declare name का external linking होता है |
यूजर define namespace के अलावा global namespace भी होता है | global name space को file level decalretive region मे declare किया जाता है | अतः global variable को global namespace मे ही declare किया जाता है |
इस उदहारण मे jack और jill namespace मे declare function , variable और struture name मे fusion नहीं होता है |
name space को declare और define करने के लिए name space की तरह होता है |
name space open होते है | किसी name space मे कभी भी name को add किया जासकता है | उदाहरन के लिए
namespace jill{
char * goose(const char *);
}
इस उदाहरन मे name jill मे एक नए name goose को add किया जा सकता है |
इस उदहारण मे jack namespace मे function fetch() को देफिएँ किया जाता है | इस function को नाम एस्पस के बाद declare किया जाता है | name space को define करने के लिए निन्म syntax को use किया जाता है :-
namesapce jack
{
void fetch ()
{
……..
……..
……..
}
}
इस article मे name space के basic को discuss किया है अब आगे एक article मे namespace के advance methodology को discuss करेगे |
Recent Posts
नियत वेग से गतिशील बिन्दुवत आवेश का विद्युत क्षेत्र ELECTRIC FIELD OF A POINT CHARGE MOVING WITH CONSTANT VELOCITY in hindi
ELECTRIC FIELD OF A POINT CHARGE MOVING WITH CONSTANT VELOCITY in hindi नियत वेग से…
four potential in hindi 4-potential electrodynamics चतुर्विम विभव किसे कहते हैं
चतुर्विम विभव (Four-Potential) हम जानते हैं कि एक निर्देश तंत्र में विद्युत क्षेत्र इसके सापेक्ष…
Relativistic Electrodynamics in hindi आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा
आपेक्षिकीय विद्युतगतिकी नोट्स क्या है परिभाषा Relativistic Electrodynamics in hindi ? अध्याय : आपेक्षिकीय विद्युतगतिकी…
pair production in hindi formula definition युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए
युग्म उत्पादन किसे कहते हैं परिभाषा सूत्र क्या है लिखिए pair production in hindi formula…
THRESHOLD REACTION ENERGY in hindi देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा
देहली अभिक्रिया ऊर्जा किसे कहते हैं सूत्र क्या है परिभाषा THRESHOLD REACTION ENERGY in hindi…
elastic collision of two particles in hindi definition formula दो कणों की अप्रत्यास्थ टक्कर क्या है
दो कणों की अप्रत्यास्थ टक्कर क्या है elastic collision of two particles in hindi definition…