Question: Consider the code snippet below, which uses the base - class Question and the derived class ChoiceQuestion: Question * quiz [ 2 ] ; quiz
Consider the code snippet below, which uses the baseclass Question and the derived class ChoiceQuestion:
Question quiz;
quiz new Question;
quizsettextWho was the inventor of C;
quizsetanswerBjarne Stroustrup";
ChoiceQuestion cqpointer new ChoiceQuestion;
cqpointersettextIn which country was the inventor of C born?";
cqpointeraddchoiceAustralia false;
quiz cqpointer;
Why is the last line of code not a type mismatch?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
