Which statement correctly describes function overloading and function overriding in C++?

Options

  • A. Overloading requires the same function name with different parameter lists.
  • B. Overriding redefines an inherited virtual function in a derived class with a matching signature.
  • C. Overloading is generally resolved at compile time, while virtual overriding supports runtime dispatch.
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

D. More than one of the above

Detailed Explanation

Correct Answer: Option D

Explanation:
Statements A, B, and C are correct. Function overloading uses the same name with different parameter lists and is resolved using compile-time overload resolution. Overriding replaces an inherited virtual function implementation, enabling runtime polymorphism when called through a base pointer or reference.