📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!


    Question

    In C++, if a base class has a virtual function, and a

    derived class overrides that function, which mechanism ensures that the correct derived class function is called at runtime, even when accessed via a base class pointer?
    A Function Overloading Correct Answer Incorrect Answer
    B Static Binding Correct Answer Incorrect Answer
    C Dynamic Binding (Polymorphism) Correct Answer Incorrect Answer
    D Operator Overloading Correct Answer Incorrect Answer
    E Template Metaprogramming Correct Answer Incorrect Answer

    Solution

    Answer: C) Dynamic Binding (Polymorphism)

    Practice Next
    ask-question