Top "Pure-virtual" questions

A virtual function that must be implemented by every non-abstract derived class.

How do you declare an interface in C++?

How do I setup a class that represents an interface? Is this just an abstract base class?

c++ inheritance interface abstract-class pure-virtual
Difference between a virtual function and a pure virtual function

What is the difference between a pure virtual function and a virtual function? I know "Pure Virtual Function is a …

c++ function pure-virtual
Error: expected type-specifier before 'ClassName'

shared_ptr<Shape> circle(new Circle(Vec2f(0, 0), 0.1, Vec3f(1, 0, 0))); shared_ptr<Shape> rect(new Rect2…

c++ shared-ptr pure-virtual
"Cannot allocate an object of abstract type" error

Error is here: vector<Graduate *> graduates; graduates.push_back(new AliceUniversity(identifier,id,salary,average)); Grandparent class: Graduate::…

c++ vector data-structures pure-virtual
Where do "pure virtual function call" crashes come from?

I sometimes notice programs that crash on my computer with the error: "pure virtual function call". How do these programs …

c++ polymorphism virtual-functions pure-virtual
Why do we need a pure virtual destructor in C++?

I understand the need for a virtual destructor. But why do we need a pure virtual destructor? In one of …

c++ destructor pure-virtual
Pure virtual function with implementation

My basic understanding is that there is no implementation for a pure virtual function, however, I was told there might …

c++ pure-virtual
cannot declare variable ‘’ to be of abstract type ‘’

EDIT: After spending a bit of time understanding the code I wrote I still don't know what is wrong with …

c++ inheritance gcc abstract-class pure-virtual
Pure virtual destructor in C++

Is it wrong to write: class A { public: virtual ~A() = 0; }; for an abstract base class? At least that compiles in …

c++ polymorphism destructor pure-virtual
Pure virtual methods in C#?

I've been told to make my class abstract: public abstract class Airplane_Abstract And to make a method called move …

c# abstract-class pure-virtual