For the following C program struct base {int a,b; base(); int virtual function1();} struct derv1:base {int b,c,d; derv1() int virtual function1();} struct derv2 : base {int a,e; } base::base() {a=2;b=3; } derv1::derv1() {b=5; c=10;d=11;} base::function1() {return(100); } derv1::function1() { return(200); } main() base ba; derv1 d1,d2; printf("%d %d",d1.a,d1.B. Output of the program is: A. a=2;b=3; B. a=3; b=2; C. a=5; b=10; D. none

Showing Answers 1 - 2 of 2 Answers

bhavik rathod

  • Jul 7th, 2006
 

ans is D.

Inheritance of structure can not be possible in c++

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions