1 Question 1 EN + हिं GB What is the output: int x=10; int *p=&x; *p=20; cout< IN आउटपुट क्या है: int x=10; int *p=&x; *पी=20; अदालत A 10 10 B 20 20 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) *p dereferences pointer to x; *p=20 sets x=20. व्याख्या (हिन्दी) *p सूचक को x से संदर्भित करता है; *p=20 सेट x=20. 🎯 Exam Perspective OOP Using C++ ("Pointers" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: int x=10; const int *p=&x; *p=20; c... What is the output: int a[]={1,2,3,4,5}; int *p=a+2; co... What is the output: void* p=(void*)42; cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
2 Question 2 EN + हिं GB What is a 'dangling pointer'? IN 'लटकता सूचक' क्या है? A Pointer to freed/destroyed memory मुक्त/नष्ट की गई स्मृति का सूचक B Null pointer नल पॉइंटर C Void pointer शून्य सूचक D Pointer to stack ढेर करने के लिए सूचक ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A dangling pointer points to memory that has been freed or gone out of scope, causing UB if dereferenced. व्याख्या (हिन्दी) एक लटकता हुआ सूचक उस मेमोरी की ओर इशारा करता है जो मुक्त हो गई है या दायरे से बाहर हो गई है, जिससे डीरेफ़रेंस होने पर यूबी उत्पन्न होता है। 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Pointers" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is a 'smart pointer' in C++? What is the output: int x=10; int &r=x; int *p=&r; *p=2... What is the output: int a=1,b=2; int *p=&a; p=&b; *p=10... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
3 Question 3 EN + हिं GB What is the output: int a=1,b=2; int *p=&a; p=&b; *p=10; cout< IN आउटपुट क्या है: int a=1,b=2; int *p=&a; पी=&बी; *पी=10; अदालत A 1 10 1 10 B 10 10 10 10 C 1 2 1 2 D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p is reassigned to &b. *p=10 sets b=10. a is unchanged. Output: 110. व्याख्या (हिन्दी) p को &b को पुनः सौंपा गया है। *पी=10 सेट बी=10. ए अपरिवर्तित है. आउटपुट: 110. 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Pointers" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is the output: int x=5; int *p=nullptr; cout What is 'double pointer' in C++? What is the output: int x=5; int *p=&x; cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
4 Question 4 EN + हिं GB What is the output: int x=5; int *p=nullptr; cout<<(p==nullptr); IN आउटपुट क्या है: int x=5; int *p=nullptr; अदालत B 1 1 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p is null; p==nullptr is true=1. व्याख्या (हिन्दी) पी शून्य है; p==nullptr सत्य=1 है। 🎯 Exam Perspective OOP Using C++ ("Pointers" sub-topic) के इस प्रश्न को कई प्रतियोगी परीक्षाओं जैसे SSC CGL, IBPS, RRB और State-level परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें। 🔗 Related Questions What is a 'dangling pointer'? What is a 'smart pointer' in C++? What is the output: int x=5,y=10; int *p=&x; swap(p,&y)... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
5 Question 5 EN + हिं GB What is 'pointer arithmetic' in C++? IN C++ में 'पॉइंटर अंकगणित' क्या है? A Adding integers to pointers to navigate arrays सरणियों को नेविगेट करने के लिए पॉइंटर्स में पूर्णांक जोड़ना B Arithmetic on pointer values as integers पूर्णांकों के रूप में सूचक मानों पर अंकगणित C Only valid for void pointers केवल शून्य सूचकों के लिए मान्य है D A compile error एक संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Pointer arithmetic (p+n) moves pointer by n*sizeof(*p) bytes, valid within array bounds. व्याख्या (हिन्दी) पॉइंटर अंकगणित (p+n) पॉइंटर को n*sizeof(*p) बाइट्स द्वारा ले जाता है, जो सरणी सीमाओं के भीतर मान्य है। 🎯 Exam Perspective यह सवाल OOP Using C++ ("Pointers" sub-topic) category का है, और UPSC, SSC, Banking और Police भर्ती के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें। 🔗 Related Questions What is a 'smart pointer' in C++? What is the output: int arr[]={1,2,3}; int *p=arr; cout What is the output: int x=10; int &r=x; int *p=&r; *p=2... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
6 Question 6 EN + हिं GB What is the output: int a[]={1,2,3,4,5}; int *p=a+2; cout< IN आउटपुट क्या है: int a[]={1,2,3,4,5}; int *p=a+2; अदालत A 234 234 B 345 345 C 123 123 D Undefined अपरिभाषित ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p=a+2=&a[2]. p[-1]=a[1]=2, p[0]=a[2]=3, p[1]=a[3]=4. Output: 234. व्याख्या (हिन्दी) पी=ए+2=&ए[2]. पी[-1]=ए[1]=2, पी[0]=ए[2]=3, पी[1]=ए[3]=4। आउटपुट: 234. 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Pointers" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: int x=10; int *p=&x; *p=20; cout What is a 'dangling pointer'? What is the output: void* p=(void*)42; cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
7 Question 7 EN + हिं GB What is the output: void* p=(void*)42; cout<<(int)(size_t)p; IN आउटपुट क्या है: void* p=(void*)42; अदालत A 42 42 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Casting integer to void* and back is implementation-defined; on most platforms returns 42. व्याख्या (हिन्दी) पूर्णांक को void* और वापस कास्ट करना कार्यान्वयन-परिभाषित है; अधिकांश प्लेटफ़ॉर्म पर 42 रिटर्न मिलता है। 🎯 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 x=5; int *p=nullptr; cout What is the output: int a[]={1,2,3,4,5}; int *p=a+2; co... What is the output: int x=10; int &r=x; int *p=&r; *p=2... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
8 Question 8 EN + हिं GB What is a 'smart pointer' in C++? IN C++ में 'स्मार्ट पॉइंटर' क्या है? A A pointer with automatic memory management स्वचालित मेमोरी प्रबंधन वाला एक सूचक B A pointer to a class किसी वर्ग के लिए सूचक C A faster raw pointer एक तेज़ कच्चा सूचक D A compile-time pointer एक संकलन-समय सूचक ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Smart pointers (unique_ptr, shared_ptr, weak_ptr) manage heap memory automatically through RAII. व्याख्या (हिन्दी) स्मार्ट पॉइंटर्स (यूनिक_पीटीआर, शेयर्ड_पीटीआर, वीक_पीटीआर) आरएआईआई के माध्यम से हीप मेमोरी को स्वचालित रूप से प्रबंधित करते हैं। 🎯 Exam Perspective SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Pointers" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: int a=1,b=2; int *p=&a; p=&b; *p=10... What is 'placement new' in C++? What is the output: int x=5; int *p=&x; cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
9 Question 9 EN + हिं GB What is the output: int x=10; const int *p=&x; *p=20; cout< IN आउटपुट क्या है: int x=10; स्थिरांक int *p=&x; *पी=20; अदालत A 10 10 B 20 20 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p is pointer to const int; *p=20 tries to modify through const pointer: compile error. व्याख्या (हिन्दी) p const int का सूचक है; *p=20 कॉन्स्ट पॉइंटर के माध्यम से संशोधित करने का प्रयास करता है: संकलन त्रुटि। 🎯 Exam Perspective अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो OOP Using C++ ("Pointers" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is 'pointer arithmetic' in C++? What is the output: int x=10; int &r=x; int *p=&r; *p=2... What is the output: void* p=(void*)42; cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
10 Question 10 EN + हिं GB What is the output: int x=5,y=10; int *p=&x; swap(p,&y); cout< IN आउटपुट क्या है: int x=5,y=10; int *p=&x; स्वैप (पी,&वाई); अदालत A Undefined अपरिभाषित B 5 10 5 10 C Compile error संकलन त्रुटि D 10 5 10 5 ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) swap(p, &y) — p is int*, &y is int*. Types match; swaps p to point to y. x and y values unchanged. Actually this is swapping the pointer, not the values. So x=5,y=10 unchanged. Wait, std::swap on pointers swaps what they point to — no, it swaps the pointers themselves. cout< व्याख्या (हिन्दी) स्वैप(p, &y) - p int* है, &y int* है। प्रकार मेल खाते हैं; Y को इंगित करने के लिए p को स्वैप करता है। x और y मान अपरिवर्तित हैं। दरअसल यह पॉइंटर की अदला-बदली है, मूल्यों की नहीं। तो x=5,y=10 अपरिवर्तित। रुको, पॉइंटर्स पर std::swap वे जो इंगित करते हैं उसे स्वैप करता है - नहीं, यह पॉइंटर्स को स्वयं स्वैप करता है। अदालत 🎯 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; int &r=x; int *p=&r; *p=2... What is the output: int a[]={1,2,3,4,5}; int *p=a+2; co... What is the output: int x=10; const int *p=&x; *p=20; c... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
11 Question 11 EN + हिं GB What is 'double pointer' in C++? IN C++ में 'डबल पॉइंटर' क्या है? A Pointer to a pointer सूचक को सूचक B Pointer to double type डबल टाइप करने के लिए सूचक C Two pointers दो सूचक D 64-bit pointer 64-बिट सूचक ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) A double pointer (int**) stores the address of another pointer. व्याख्या (हिन्दी) एक डबल पॉइंटर (int**) दूसरे पॉइंटर का पता संग्रहीत करता है। 🎯 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 the output: int x=5; int *p=&x; cout What is a 'smart pointer' in C++? What is the output: int a[]={1,2,3,4,5}; int *p=a+2; co... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
12 Question 12 EN + हिं GB What is the output: int arr[]={1,2,3}; int *p=arr; cout< IN आउटपुट क्या है: int arr[]={1,2,3}; int *p=arr; अदालत A Address 2 पता 2 B 1 2 1 2 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) p++ and *p in same cout without sequencing (pre-C++17) is unspecified/undefined behavior. व्याख्या (हिन्दी) p++ और *p अनुक्रमण के बिना एक ही कॉउट में (पूर्व-C++17) अनिर्दिष्ट/अपरिभाषित व्यवहार है। 🎯 Exam Perspective यह प्रश्न OOP Using C++ ("Pointers" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें। 🔗 Related Questions What is the output: int x=10; int *p=&x; *p=20; cout What is the output: int x=5,y=10; int *p=&x; swap(p,&y)... What is the output: int x=10; int &r=x; int *p=&r; *p=2... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
13 Question 13 EN + हिं GB What is the output: int x=10; int &r=x; int *p=&r; *p=20; cout< IN आउटपुट क्या है: int x=10; int &r=x; int *p=&r; *पी=20; अदालत A 10 10 B 20 20 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) &r is the address of x (reference aliases x). *p=20 sets x=20. Output: 20. व्याख्या (हिन्दी) &r x (संदर्भ उपनाम x) का पता है। *p=20 सेट x=20. आउटपुट: 20. 🎯 Exam Perspective OOP Using C++ ("Pointers" sub-topic) से जुड़ा यह सवाल उन students के लिए काम का है जो UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो। 🔗 Related Questions What is the output: int x=5; int *p=&x; cout What is the output: int a[]={1,2,3,4,5}; int *p=a+2; co... What is a 'dangling pointer'? 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
14 Question 14 EN + हिं GB What is 'placement new' in C++? IN C++ में 'प्लेसमेंट न्यू' क्या है? A Allocates on stack स्टैक पर आवंटित करता है B Constructs object at specified memory address निर्दिष्ट मेमोरी पते पर ऑब्जेक्ट का निर्माण करता है C Replaces global new वैश्विक नए की जगह लेता है D Only for arrays केवल सरणियों के लिए ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) Placement new: new(ptr) T(args) constructs object at given memory without allocation. व्याख्या (हिन्दी) प्लेसमेंट नया: new(ptr) T(args) आवंटन के बिना दी गई मेमोरी पर ऑब्जेक्ट का निर्माण करता है। 🎯 Exam Perspective Railway, SSC, Banking और Defence परीक्षाओं जैसी परीक्षाओं में OOP Using C++ ("Pointers" sub-topic) से सवाल अक्सर पूछे जाते हैं। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें। 🔗 Related Questions What is the output: int x=10; int &r=x; int *p=&r; *p=2... What is the output: int x=10; int *p=&x; *p=20; cout What is the output: int x=5; int *p=nullptr; cout 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)
15 Question 15 EN + हिं GB What is the output: int x=5; int *p=&x; cout<<**&p; IN आउटपुट क्या है: int x=5; int *p=&x; अदालत A Address पता B 5 5 C Undefined अपरिभाषित D Compile error संकलन त्रुटि ✅ Correct Answer: 💡 Explanation / व्याख्या Explanation (English) &p is address of pointer p. *&p = p (the pointer). *(*&p) = *p = x = 5. व्याख्या (हिन्दी) &p पॉइंटर पी का पता है। *&p = p (सूचक)। *(*&p) = *p = x = 5. 🎯 Exam Perspective अगर आप SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं, तो OOP Using C++ ("Pointers" sub-topic) का यह topic आपके लिए महत्वपूर्ण है। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें। 🔗 Related Questions What is a 'smart pointer' in C++? What is the output: int a=1,b=2; int *p=&a; p=&b; *p=10... What is the output: int x=5,y=10; int *p=&x; swap(p,&y)... 📚 Related Topic Introduction to C++ (187) Variables and Data Types (160) Operators in C++ (163)