16 Question 16 EN + हिं GB What does 'delete[]' do vs 'delete'? IN 'डिलीट[]' बनाम 'डिलीट' क्या करता है? A delete[] frees array, delete frees single object हटाएँ[] सरणी को मुक्त करता है, हटाएँ एकल वस्तु को मुक्त करता है B They are identical वे समान हैं C delete[] is for vectors delete[] वैक्टर के लिए है D delete[] calls destructor once delete[] डिस्ट्रक्टर को एक बार कॉल करता है ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) delete[] calls destructor for each element and frees the array; delete only calls destructor once. व्याख्या (हिन्दी) हटाएं[] प्रत्येक तत्व के लिए विध्वंसक को कॉल करता है और सरणी को मुक्त करता है; कॉल डिस्ट्रक्टर को केवल एक बार हटाएं। 🎯 Exam Perspective OOP Using C++ ("Pointers" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: int* p=new int(42); cout What is the output: int f(){return 42;} int (*p)()=f; c... What is 'aliasing' in the context of pointers? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
17 Question 17 EN + हिं GB What is the output: int* p=new int(42); cout<<*p; delete p; cout<<*p; IN आउटपुट क्या है: int* p=new int(42); अदालत A 42 42 42 42 B 42 0 42 0 C 42 then UB 42 फिर यूबी D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Accessing memory after delete is undefined behavior (use-after-free). व्याख्या (हिन्दी) डिलीट के बाद मेमोरी तक पहुंच अपरिभाषित व्यवहार (उपयोग-बाद-मुक्त) है। 🎯 Exam Perspective यह सवाल OOP Using C++ ("Pointers" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: int f(){return 42;} int (*p)()=f; c... What is 'aliasing' in the context of pointers? What does 'delete[]' do vs 'delete'? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
18 Question 18 EN + हिं GB What is 'wild pointer'? IN 'वाइल्ड पॉइंटर' क्या है? A Uninitialized pointer अप्रारंभीकृत सूचक B Null pointer नल पॉइंटर C Pointer past array end सूचक पिछले सरणी अंत D Pointer to global वैश्विक की ओर सूचक ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A wild pointer is an uninitialized pointer that may point to arbitrary memory location. व्याख्या (हिन्दी) वाइल्ड पॉइंटर एक अप्रारंभीकृत पॉइंटर है जो मनमाने ढंग से मेमोरी स्थान को इंगित कर सकता है। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Pointers" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: int* p=new int[5]{1,2,3,4,5}; cout What is 'aliasing' in the context of pointers? What is shared_ptr reference count? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
19 Question 19 EN + हिं GB What is the output: int a=1,b=2; int *p=&a,*q=&b; *p=*q; cout< IN आउटपुट क्या है: int a=1,b=2; int *p=&a,*q=&b; *पी=*क्यू; अदालत A 22 22 B 12 12 C 21 21 D 11 11 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) *p=*q copies value of b into a. a becomes 2, b stays 2. Output: 22. व्याख्या (हिन्दी) *p=*q b के मान को a में कॉपी करता है। ए 2 हो जाता है, बी 2 रहता है। आउटपुट: 22। 🎯 Exam Perspective OOP Using C++ ("Pointers" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: int a[]={1,2,3,4,5}; int *p=a+5; co... What is shared_ptr reference count? What is 'aliasing' in the context of pointers? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
20 Question 20 EN + हिं GB What is the output: int x=5; int *p=&x; p=nullptr; cout<<(p?*p:0); IN आउटपुट क्या है: int x=5; int *p=&x; p=nullptr; अदालत A 5 5 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p is set to nullptr; (p?*p:0): p is false, returns 0. व्याख्या (हिन्दी) p को nullptr पर सेट किया गया है; (पी?*पी:0): पी गलत है, 0 लौटाता है। 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Pointers" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is 'wild pointer'? What is the output: int a=1,b=2; int *p=&a,*q=&b; *p=*q... What is the output: int x=5; auto p=make_unique(x); *p=... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
21 Question 21 EN + हिं GB What is std::unique_ptr? IN std::unique_ptr क्या है? A Shared ownership smart pointer साझा स्वामित्व स्मार्ट सूचक B Exclusive ownership smart pointer (non-copyable) विशिष्ट स्वामित्व स्मार्ट पॉइंटर (गैर-प्रतिलिपि योग्य) C Weak reference smart pointer कमजोर संदर्भ स्मार्ट सूचक D Raw pointer wrapper कच्चा सूचक आवरण ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) unique_ptr has exclusive ownership; it cannot be copied, only moved; deletes object on destruction. व्याख्या (हिन्दी) अद्वितीय_पीटीआर के पास विशेष स्वामित्व है; इसे कॉपी नहीं किया जा सकता, केवल स्थानांतरित किया जा सकता है; नष्ट होने पर वस्तु को हटा देता है। 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Pointers" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: int f(){return 42;} int (*p)()=f; c... What is shared_ptr reference count? What is the output: int a[]={1,2,3,4,5}; int *p=a+5; co... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
22 Question 22 EN + हिं GB What is the output: int a[]={10,20,30}; int *p=a; cout<<*(p++); IN आउटपुट क्या है: int a[]={10,20,30}; int *p=a; अदालत A 10 10 B 20 20 C 30 30 D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p++ returns current p (pointing to a[0]=10), then increments. Dereferences to 10. व्याख्या (हिन्दी) p++ वर्तमान p लौटाता है (a[0]=10 की ओर इंगित करता है), फिर वृद्धि करता है। 10 से सन्दर्भ. 🎯 Exam Perspective OOP Using C++ ("Pointers" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: int x=10; void *p=&x; cout What is the output: int* p=new int(42); cout What does 'delete[]' do vs 'delete'? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
23 Question 23 EN + हिं GB What is 'pointer to function' in C++? IN C++ में 'पॉइंटर टू फंक्शन' क्या है? A A variable storing address of a function किसी फ़ंक्शन का एक वैरिएबल भंडारण पता B A function returning pointer एक फ़ंक्शन रिटर्निंग पॉइंटर C A member function pointer एक सदस्य फ़ंक्शन सूचक D A lambda एक लैम्ब्डा ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Function pointers store the address of a function and can be used to call it indirectly. व्याख्या (हिन्दी) फ़ंक्शन पॉइंटर्स किसी फ़ंक्शन का पता संग्रहीत करते हैं और इसे अप्रत्यक्ष रूप से कॉल करने के लिए उपयोग किया जा सकता है। 🎯 Exam Perspective यह सवाल OOP Using C++ ("Pointers" sub-topic) category का है, और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is std::unique_ptr? What is shared_ptr reference count? What is the output: int x=5; auto p=make_unique(x); *p=... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
24 Question 24 EN + हिं GB What is the output: int f(){return 42;} int (*p)()=f; cout< IN आउटपुट क्या है: int f(){return 42;} int (*p)()=f; अदालत A 42 42 C Compile error संकलन त्रुटि D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p is function pointer to f; p() calls f() which returns 42. व्याख्या (हिन्दी) p, f का फ़ंक्शन सूचक है; p() f() को कॉल करता है जो 42 लौटाता है। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Pointers" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: int* p=new int(42); cout What is the output: int a[]={1,2,3,4,5}; int *p=a+5; co... What is 'aliasing' in the context of pointers? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
25 Question 25 EN + हिं GB What is the output: int x=10; void *p=&x; cout<<*(int*)p; IN आउटपुट क्या है: int x=10; शून्य *p=&x; अदालत A 10 10 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) void* p stores address of x; cast to int* and dereference gives 10. व्याख्या (हिन्दी) void* p, x का पता संग्रहीत करता है; int* पर कास्ट करें और डीरेफ़रेंस 10 देता है। 🎯 Exam Perspective OOP Using C++ ("Pointers" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is 'pointer to function' in C++? What is the output: int a=1,b=2; int *p=&a,*q=&b; *p=*q... What is the output: int* p=new int[5]{1,2,3,4,5}; cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
26 Question 26 EN + हिं GB What is the output: int a[]={1,2,3,4,5}; int *p=a+5; cout<<*(p-1); IN आउटपुट क्या है: int a[]={1,2,3,4,5}; int *p=a+5; अदालत A 5 5 B 4 4 C Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p=a+5 (one past end). p-1=&a[4]. *(p-1)=5. व्याख्या (हिन्दी) p=a+5 (एक पिछला छोर)। पी-1=&ए[4]. *(पी-1)=5. 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Pointers" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: int* p=new int[5]{1,2,3,4,5}; cout What is 'pointer to function' in C++? What is the output: int* p=new int(42); cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
27 Question 27 EN + हिं GB What is shared_ptr reference count? IN Shared_ptr संदर्भ संख्या क्या है? A Number of shared_ptrs owning the object ऑब्जेक्ट के स्वामित्व वाले share_ptrs की संख्या B Number of times pointer is used पॉइंटर का उपयोग कितनी बार किया गया है C Garbage collection metric कचरा संग्रहण मीट्रिक D Memory address स्मृति पता ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) shared_ptr maintains a reference count; when it drops to 0, the managed object is deleted. व्याख्या (हिन्दी) Shared_ptr एक संदर्भ गणना बनाए रखता है; जब यह 0 पर गिरता है, तो प्रबंधित ऑब्जेक्ट हटा दिया जाता है। 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Pointers" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is std::unique_ptr? What is the output: int a=1,b=2; int *p=&a,*q=&b; *p=*q... What is the output: int f(){return 42;} int (*p)()=f; c... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
28 Question 28 EN + हिं GB What is the output: int x=5; auto p=make_unique(x); *p=10; cout< IN आउटपुट क्या है: int x=5; ऑटो p=make_unique(x); *पी=10; अदालत A 5 5 B 10 10 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) make_unique creates a new int with value x (copy). *p=10 doesn't affect x. Output: 5. व्याख्या (हिन्दी) make_unique मान x (कॉपी) के साथ एक नया int बनाता है। *p=10 x को प्रभावित नहीं करता. आउटपुट: 5. 🎯 Exam Perspective OOP Using C++ ("Pointers" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is the output: int f(){return 42;} int (*p)()=f; c... What is the output: int a=1,b=2; int *p=&a,*q=&b; *p=*q... What is the output: int a[]={1,2,3,4,5}; int *p=a+5; co... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
29 Question 29 EN + हिं GB What is 'aliasing' in the context of pointers? IN सूचकों के संदर्भ में 'अलियासिंग' क्या है? A Two pointers pointing to the same memory एक ही मेमोरी की ओर इशारा करने वाले दो संकेतक B A typedef for pointer type सूचक प्रकार के लिए एक टाइपडिफ़ C Pointer casting सूचक कास्टिंग D Reference to pointer सूचक का संदर्भ ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Pointer aliasing occurs when two different pointers point to the same memory location, which can affect optimization. व्याख्या (हिन्दी) पॉइंटर अलियासिंग तब होता है जब दो अलग-अलग पॉइंटर एक ही मेमोरी लोकेशन की ओर इशारा करते हैं, जो अनुकूलन को प्रभावित कर सकता है। 🎯 Exam Perspective यह सवाल OOP Using C++ ("Pointers" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is the output: int x=10; void *p=&x; cout What is the output: int f(){return 42;} int (*p)()=f; c... What does 'delete[]' do vs 'delete'? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
30 Question 30 EN + हिं GB What is the output: int* p=new int[5]{1,2,3,4,5}; cout< IN आउटपुट क्या है: int* p=new int[5]{1,2,3,4,5}; अदालत A 5 5 B 4 4 D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) new int[5]{1,2,3,4,5} initializes array; p[4]=5. व्याख्या (हिन्दी) नया int[5]{1,2,3,4,5} सरणी प्रारंभ करता है; पी[4]=5. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Pointers" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: int* p=new int(42); cout What is the output: int x=10; void *p=&x; cout What is the output: int a=1,b=2; int *p=&a,*q=&b; *p=*q... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)