16 Question 16 EN + हिं GB What is 'aggregate initialization'? IN 'समग्र आरंभीकरण' क्या है? A Initializing aggregate types with brace-enclosed list ब्रेस-संलग्न सूची के साथ समुच्चय प्रकारों को प्रारंभ करना B Initializing arrays only केवल आरंभिक सरणियाँ C Virtual class initialization वर्चुअल क्लास आरंभीकरण D Constructor with multiple params एकाधिक पैरामीटर वाला कंस्ट्रक्टर ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Aggregates (classes with no user-defined constructors, etc.) can be initialized with {val1, val2, ...}. व्याख्या (हिन्दी) एग्रीगेट्स (बिना उपयोगकर्ता-परिभाषित कंस्ट्रक्टर वाली कक्षाएं, आदि) को {val1, val2, ...} के साथ प्रारंभ किया जा सकता है। 🎯 Exam Perspective OOP Using C++ ("Classes and Objects" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: class A{int x=0; public: void inc()... What is a 'nested class' in C++? What is the output: class A{public: int x=10; int f() c... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
17 Question 17 EN + हिं GB What is the output: class A{public: int x=10; int f() const {return x;}}; const A a; cout< IN आउटपुट क्या है: class A{public: int x=10; int f() स्थिरांक {वापसी x;}}; स्थिरांक ए ए; अदालत A 10 10 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) const object can only call const member functions. f() is const and returns x=10. व्याख्या (हिन्दी) कॉन्स्ट ऑब्जेक्ट केवल कॉन्स्ट सदस्य फ़ंक्शंस को कॉल कर सकता है। f() स्थिरांक है और x=10 लौटाता है। 🎯 Exam Perspective यह सवाल OOP Using C++ ("Classes and Objects" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public: int x; A(int v=0):x... What is 'type punning' in C++? What is the output: class A{public: virtual void f(){co... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
18 Question 18 EN + हिं GB What is 'explicit' constructor? IN 'स्पष्ट' कंस्ट्रक्टर क्या है? A Prevents implicit conversion of constructor argument कंस्ट्रक्टर तर्क के अंतर्निहित रूपांतरण को रोकता है B Makes constructor public कंस्ट्रक्टर को सार्वजनिक बनाता है C Forces inline expansion इनलाइन विस्तार को बल देता है D Deletes copy constructor कॉपी कंस्ट्रक्टर को हटाता है ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) explicit prevents the constructor from being used in implicit conversions or copy-initialization. व्याख्या (हिन्दी) स्पष्ट कन्स्ट्रक्टर को अंतर्निहित रूपांतरण या प्रतिलिपि-प्रारंभिकरण में उपयोग करने से रोकता है। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Classes and Objects" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{public: int x=5; int& f(){r... What is 'aggregate initialization'? What is the output: class A{public: int x; A(int v=0):x... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
19 Question 19 EN + हिं GB What is the output: class A{public: static void f(){cout<<'S';} void g(){cout<<'G';}}; A::f(); A a; a.g(); IN आउटपुट क्या है: क्लास ए {सार्वजनिक: स्थिर शून्य एफ() {काउट A SG एसजी B GS जी एस C Compile error संकलन त्रुटि D SS एसएस ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A::f() calls static f, prints S. a.g() calls instance g, prints G. Output: SG. व्याख्या (हिन्दी) A::f() स्टेटिक f को कॉल करता है, S को प्रिंट करता है। a.g() इंस्टेंस g को कॉल करता है, G को प्रिंट करता है। आउटपुट: SG। 🎯 Exam Perspective OOP Using C++ ("Classes and Objects" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is 'CRTP' (Curiously Recurring Template Pattern)? What is 'aggregate initialization'? What is the output: class A{public: int x=10; int f() c... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
20 Question 20 EN + हिं GB What is the output: class A{public: int x; A(int v=0):x(v){}}; A a=5; cout< IN आउटपुट क्या है: क्लास ए {सार्वजनिक: int x; A(int v=0):x(v){}}; ए ए=5; अदालत A 5 5 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A a=5 uses implicit conversion (copy-initialization): calls A(5), x=5. Output: 5. व्याख्या (हिन्दी) A a=5 अंतर्निहित रूपांतरण (कॉपी-इनिशियलाइज़ेशन) का उपयोग करता है: A(5), x=5 को कॉल करता है। आउटपुट: 5. 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Classes and Objects" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: class A{public: ~A(){cout What is 'CRTP' (Curiously Recurring Template Pattern)? What is the output: class A{public: static void f(){cou... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
21 Question 21 EN + हिं GB What is a 'nested class' in C++? IN C++ में 'नेस्टेड क्लास' क्या है? A A class defined inside another class एक वर्ग को दूसरे वर्ग के अंदर परिभाषित किया गया है B A class with multiple inheritance एकाधिक वंशानुक्रम वाला एक वर्ग C A template class एक टेम्पलेट क्लास D Abstract class सार वर्ग ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A nested class is defined within the scope of an enclosing class. व्याख्या (हिन्दी) एक नेस्टेड वर्ग को एक संलग्न वर्ग के दायरे में परिभाषित किया गया है। 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Classes and Objects" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public: int x; A(int v=0):x... What is the output: class A{public: ~A(){cout What is the output: class A{public: int x=5; int& f(){r... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
22 Question 22 EN + हिं GB What is the output: class A{public: ~A(){cout<<'D';}}; A *p=new A; delete p; IN आउटपुट क्या है: क्लास ए {सार्वजनिक: ~ ए() {काउट A D डी B Nothing कुछ नहीं C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) delete p calls destructor, which prints D. व्याख्या (हिन्दी) डिलीट पी कॉल डिस्ट्रक्टर, जो डी प्रिंट करता है। 🎯 Exam Perspective OOP Using C++ ("Classes and Objects" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public: A(){cout What is the output: class A{public: int x; A(int v=0):x... What is the output: class A{public: int x=10; int f() c... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
23 Question 23 EN + हिं GB What is 'method chaining' in C++? IN C++ में 'मेथड चेनिंग' क्या है? A Returning *this from member functions to chain calls *इसे सदस्य फ़ंक्शंस से चेन कॉल पर लौटाना B Calling multiple methods sequentially एकाधिक विधियों को क्रमिक रूप से कॉल करना C Virtual method dispatch आभासी विधि प्रेषण D Template method pattern टेम्पलेट विधि पैटर्न ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Returning *this from methods enables: obj.setX(1).setY(2).setZ(3) style chaining. व्याख्या (हिन्दी) तरीकों से इसे वापस करने से सक्षम होता है: obj.setX(1).setY(2).setZ(3) स्टाइल चेनिंग। 🎯 Exam Perspective यह सवाल OOP Using C++ ("Classes and Objects" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public: A(){cout What is the output: class A{public: int x=5; int& f(){r... What is the output: class A{public: ~A(){cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
24 Question 24 EN + हिं GB What is the output: struct A{int x,y; A(int a,int b):x(a),y(b){}}; A a{3,4}; cout< IN आउटपुट क्या है: struct A{int x,y; A(int a,int b):x(a),y(b){}}; ए ए{3,4}; अदालत A 7 7 B 12 12 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A a{3,4} calls constructor: x=3,y=4. x+y=7. Output: 7. व्याख्या (हिन्दी) A a{3,4} कंस्ट्रक्टर को कॉल करता है: x=3,y=4। x+y=7. आउटपुट: 7. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Classes and Objects" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is 'explicit' constructor? What is the output: class A{public: A(){cout What is 'CRTP' (Curiously Recurring Template Pattern)? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
25 Question 25 EN + हिं GB What is 'CRTP' (Curiously Recurring Template Pattern)? IN 'सीआरटीपी' (क्यूरियसली रिकरिंग टेम्पलेट पैटर्न) क्या है? A Base class template parameterized with derived class बेस क्लास टेम्पलेट को व्युत्पन्न क्लास के साथ पैरामीटरयुक्त किया गया है B Recursive template instantiation पुनरावर्ती टेम्पलेट इन्स्टेन्शियशन C Multiple inheritance pattern एकाधिक वंशानुक्रम पैटर्न D Virtual function replacement वर्चुअल फ़ंक्शन प्रतिस्थापन ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) CRTP: template class Base{}; class Derived: public Base{}; enables static polymorphism. व्याख्या (हिन्दी) सीआरटीपी: टेम्पलेट क्लास बेस{}; वर्ग व्युत्पन्न: सार्वजनिक आधार{}; स्थैतिक बहुरूपता को सक्षम बनाता है। 🎯 Exam Perspective OOP Using C++ ("Classes and Objects" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is 'type punning' in C++? What is the output: class A{public: int x; A(int v=0):x... What is the output: class A{public: int x=5; int& f(){r... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
26 Question 26 EN + हिं GB What is the output: class A{public: int x=5; int& f(){return x;}}; A a; a.f()=10; cout< IN आउटपुट क्या है: class A{public: int x=5; int& f(){रिटर्न x;}}; ए ए; a.f()=10; अदालत A 5 5 B 10 10 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) f() returns reference to x. Assigning 10 to it sets x=10. Output: 10. व्याख्या (हिन्दी) f() x का संदर्भ लौटाता है। इसमें 10 निर्दिष्ट करने पर x=10 सेट हो जाता है। आउटपुट: 10. 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Classes and Objects" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: class A{public: static void f(){cou... What is a 'nested class' in C++? What is 'explicit' constructor? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
27 Question 27 EN + हिं GB What is the output: class A{int x=0; public: void inc(){x++;} int get()const{return x;}}; A a,b=a; a.inc(); cout< IN आउटपुट क्या है: class A{int x=0; सार्वजनिक: void inc(){x++;} int get()const{return x;}}; ए ए,बी=ए; a.inc(); अदालत A 10 10 B 11 11 C 01 01 D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) b is a copy of a (x=0). a.inc() makes a.x=1. b.x stays 0. Output: 10. व्याख्या (हिन्दी) b, a (x=0) की एक प्रति है। a.inc() a.x=1 बनाता है। b.x 0 रहता है। आउटपुट: 10। 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Classes and Objects" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public: virtual void f(){co... What is 'method chaining' in C++? What is 'CRTP' (Curiously Recurring Template Pattern)? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
28 Question 28 EN + हिं GB What is 'type punning' in C++? IN C++ में 'टाइप पनिंग' क्या है? A Reinterpreting memory as different type स्मृति को भिन्न प्रकार के रूप में पुनःव्याख्या करना B Type aliasing with typedef टाइपडिफ के साथ अलियासिंग टाइप करें C Template specialization टेम्पलेट विशेषज्ञता D Dynamic casting गतिशील कास्टिंग ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Type punning reads object representation as a different type, often via union or memcpy, sometimes undefined behavior with pointer casts. व्याख्या (हिन्दी) टाइप पनिंग ऑब्जेक्ट प्रतिनिधित्व को एक अलग प्रकार के रूप में पढ़ता है, अक्सर यूनियन या मेम्सीपी के माध्यम से, कभी-कभी पॉइंटर कास्ट के साथ अपरिभाषित व्यवहार। 🎯 Exam Perspective OOP Using C++ ("Classes and Objects" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is 'CRTP' (Curiously Recurring Template Pattern)? What is 'explicit' constructor? What is a 'nested class' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
29 Question 29 EN + हिं GB What is the output: class A{public: virtual void f(){cout<<'A';}}; class B:public A{public: void f()override{cout<<'B';}}; A*p=new B; p->f(); delete p; IN आउटपुट क्या है: क्लास ए {पब्लिक: वर्चुअल शून्य एफ() {काउट A A ए B B बी C AB अब D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Virtual dispatch: p is A* pointing to B object. p->f() calls B::f() via vtable. Output: B. व्याख्या (हिन्दी) आभासी प्रेषण: p, A* है जो B ऑब्जेक्ट की ओर इशारा करता है। p->f() vtable के माध्यम से B::f() को कॉल करता है। आउटपुट: बी. 🎯 Exam Perspective यह सवाल OOP Using C++ ("Classes and Objects" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: class A{public: static void f(){cou... What is 'explicit' constructor? What is the output: class A{public: int x=5; int& f(){r... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
30 Question 30 EN + हिं GB What is the output: class A{public: A(){cout<<'A';} A(const A&){cout<<'C';}}; A f(){return A();} A a=f(); IN आउटपुट क्या है: क्लास ए {पब्लिक: ए() {काउट A A ए B AC ए.सी C ACC एसीसी D AA आ ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) RVO/copy elision (mandatory in C++17 for prvalues) eliminates copies; only one constructor call. Output: A. व्याख्या (हिन्दी) आरवीओ/कॉपी एलिज़न (प्रचलन के लिए C++17 में अनिवार्य) प्रतियों को समाप्त करता है; केवल एक कंस्ट्रक्टर कॉल। आउटपुट: ए. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Classes and Objects" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: class A{public: ~A(){cout What is a 'nested class' in C++? What is 'type punning' in C++? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)