functions

y should we initialize any function like below -

virtual bool is_available () const =0;
that would be a pure virtual function and it would be used as a member function in an abstract base class.
is it possible to declare that virtual function in any header file and then use that function in other .cpp file without defining it? i am using visual C++ with visual studio 2008.
As long as you put that function in a class, include the header in the cpp and derive a class that overwrites this method, yes.
then is it compulsary to initialize them to zero. can it also be done by only declaring and not initializing.........................
That "=0" bit is a special syntax that doesn't have anything to do with zeros or initialization. If you exclude it, I think you'll have to define this function.
thanks
Topic archived. No new replies allowed.