🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Type Casting in C++: all 10 questions

Quiz: Type Casting in C++ · Question 8 of 10

What does an upcast mean?

What does an upcast mean?

  1. A.Converting a derived-class pointer to a base-class pointer
  2. B.Converting a base-class pointer to a derived-class pointer
  3. C.Converting int to long long
  4. D.Removing const from a pointer
Answer & explanation

Correct answer: Converting a derived-class pointer to a base-class pointer

Upcasting moves up the inheritance tree and is always safe, so it happens implicitly.

Can you get the rest right without peeking?

Take the timed Quiz: Type Casting in C++ quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →