Top 80+ Solved CPP Programming MCQ Questions Answer

From 76 to 86 of 86

Q. Which operators is part of RTTI?

a. dynamic_cast()

b. typeid

c. Both dynamic_cast() & typeid

d. None

  • c. Both dynamic_cast() & typeid

Q. At which time does the static_cast can be applied?

a. Compile-time construct

b. Runtime construct

c. Both Compile-time & Runtime construct

d. None

  • a. Compile-time construct

Q. Which function is used to position back from the end of file object?

a. seekg

b. seekp

c. both seekg & seekp

d. None

  • a. seekg

Q. String class have a concat() function that is used to _____________________

a. Replace old string by new string

b. Add two strings

c. Append one string at end of another string

d. Remove a string from end of one string

  • c. Append one string at end of another string

Q. Which among the following is/are type(s) of this pointer?

a. const

b. volatile

c. const or volatile

d. int

  • c. const or volatile

Q. Which is the pointer which denotes the object calling the member function?

a. Variable pointer

b. This pointer

c. Null pointer

d. Zero pointer

  • b. This pointer

Q. Which property is shown most when upcasting is used?

a. Code reusability

b. Code efficiency

c. Complex code simple syntax

d. Encapsulation

  • c. Complex code simple syntax

Q. If multiple inheritance is implemented, which upcasting will be correct?

a. Upcast to first base class listed in inheritance

b. Upcast to any base class

c. Upcast to send base class listed in inheritance

d. Upcast is not possible

  • b. Upcast to any base class

Q. When are the pointer types known for upcasting the objects?

a. Compile time

b. Runtime

c. Source code build time

d. Doesn’t apply to pointer types

  • a. Compile time

Q. Which among the following is a mandatory condition for downcasting?

a. It must not be done explicitly

b. It must be done implicitly

c. It must be done explicitly

d. It can’t be done explicitly

  • c. It must be done explicitly

Q. Which container provides random access iterators?

a. vector

b. deque

c. sort

d. both vector & deque

  • d. both vector & deque
Subscribe Now

Get All Updates & News