91
GB
What is the output: class A{public:virtual void f()=0; virtual ~A()=default;}; class B:public A{public:void f()override{}}; A *p=new B; delete p; cout<<'X';
IN
आउटपुट क्या है: class A{public:virtual void f()=0; आभासी ~ए()=डिफ़ॉल्ट;}; class B:public A{public:void f()override{}}; ए *पी=नया बी; पी हटाएं; अदालत
A
X
एक्स
B
Compile error
संकलन त्रुटि
C
Undefined
अपरिभाषित
D
UB
यूबी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
Virtual dtor ensures proper cleanup. Output: X.
व्याख्या (हिन्दी)
वर्चुअल डीटोर उचित सफाई सुनिश्चित करता है। आउटपुट: एक्स.