What’s the difference between the following two declarations?
virtual void calculateBase() = 0;
virtual void calculateBase();
I read the first one (=0) is a “pure abstract function” but what does that make the second one?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First one is called a pure virtual function. Normally pure virtual functions will not have any implementation and you can not create a instance of a class containing a pure virtual function.
Second one is a virtual function (i.e. a ‘normal’ virtual function). A class provides the implementation for this function, but its derived class can override this implementation by providing its own implementation for this method.