Re: Virtual functions and destructors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 23 March 2006 03:02, Shriramana Sharma wrote:
> Thursday, 23 March 2006 03:57 samaye tvayaa likhitam:
> > I'm not sure if this is right. Functions can always be overloaded.
>
> He did not speak of functions being overloaded. He spoke of functions being
> over-*ridden*.

Sorry I must have read wrong. Nevertheless even if you prefer to say override 
you can still override a function without using virtual. Just adjust the type 
of the pointer to the class of which you want to execute the member function.

Ben

>
> > Further I believe that once a function is declared virtual it always
> > stays that way. Even if in subsequently derived classes it is not
> > explicitly declared virtual any longer.
>
> Verified this using a grandchild class.
-
: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux