September 5th, 2002, 12:05 AM
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, 10: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, 11: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 6th, 2002, 12:28 AM
the = 0 makes it a "pure" virtual function...??
i was not aware there were different types of virtual functions????
September 6th, 2002, 12:31 AM
September 6th, 2002, 10:17 PM
great. thanks a lot guys. i'm checking that link now. thanks again.