virtual void drive() = 0

What this means?

void means no return value.

drive() is a function

but what virtual means?

and why it asigns a value of 0 to a function?How can a function have value of 0 ?

Thank you

Any decent C++ book should explain inheritance to you.

virtual void drive() = 0 is a "pure virtual function" you can search with this keywod here or here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.