Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
C++

Pure Virtual Functions in C++

Declare interfaces with `virtual void f() = 0`.

Pure Virtual Functions in C++ — a practical guide to C++ pure virtual functions with clear examples you can reuse in real projects.

C++ Tutorial Series (65/111). Prefer one article? Read the complete C++ tutorial.

Short description

A class with pure virtuals is abstract — cannot instantiate.

Pure virtual

class Shape {
public:
    virtual ~Shape() = default;
    virtual double area() const = 0;
};

Leave a reply

Your email address will not be published. Required fields are marked *