Question

In C++, how is abstraction primarily achieved when defining a class that cannot be instantiated directly but serves as a blueprint for derived classes?

A By making all member variables `private`.
B By using the `virtual` keyword for all methods.
C By declaring at least one pure virtual function (e.g., `virtual void func() = 0;`).
D By making the constructor `protected`.
E By using the `abstract` keyword (which does not exist in C++).
Practice Next

Hey! Ask a query