September 4th, 2002, 11:05 PM
i've come across this in a book, and i'm wondering what the "= 0" bit is all about
virtual methodName() = 0;
any insight would be greatly appreciated
September 5th, 2002, 09:42 AM
If this is C++, then it makes the method a pure virtual function. Any class that contains a pure virtual function cannot be instantiated; you must derive a base class in order to use it.
"Me fail English? That's unpossible!"
September 5th, 2002, 10:34 AM
Remember though that declaring a method pure virtual doesn't mean that it can not have an implementation.
Declaring it pure virtual means that the current class is abstract and that any concrete class inheriting from the surrent class must declare the function as a "normal" virtual function.
September 5th, 2002, 11:28 PM
the = 0 makes it a "pure" virtual function...??
i was not aware there were different types of virtual functions????
September 5th, 2002, 11:31 PM
September 6th, 2002, 09:17 PM
great. thanks a lot guys. i'm checking that link now. thanks again.