1711
GB
What is the output: class A{int* p; public:A(int v):p(new int(v)){} ~A(){delete p;} A(const A& o):p(new int(*o.p)){} int get()const{return *p;}}; A a(5); A b=a; *b.p=10; cout<
IN
आउटपुट क्या है: class A{int* p; सार्वजनिक:ए(int v):p(नया int(v)){} ~A(){delete p;} A(const A& o):p(new int(*o.p)){} int get()const{return *p;}}; ए ए(5); ए बी=ए; *बी.पी=10; अदालत
A
510
510
B
1010
1010
C
Compile error
संकलन त्रुटि
D
Undefined
अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English)
Deep copy: b has own int. *b.p=10. a unchanged=5. Output: 510.
व्याख्या (हिन्दी)
डीप कॉपी: बी का अपना इंट है। *बी.पी=10. एक अपरिवर्तित=5. आउटपुट: 510.