Message from C, C++ talks

June 2019

— What's acimpcp


— Or GCJ, FHC, HashCode etc..for all this?

— I dunno that 😶


What does the below statement means, can someone explain in simple words:
"There is a necessity to use the single pointer to refer to all the objects of the different classes. So, we create the pointer to the base class that refers to all the derived objects. But, when base class pointer contains the address of the derived class object, always executes the base class function. This issue can only be resolved by using the 'virtual' function."

— First read thr virtual function... then you can understand ... easily

— This is the first point in why we use virtual functions..

— How can I add graphics.h to dev-c++

— Bcz pf dynamic binding.... if you declare virtual function in base class.... it will overridable....

— /

— Simply declare the members function in the derived class and define a new implimentation for that member function

Message permanent page

— Ok thanks 😁👍

— Got the point or not? Still confused

— Bcz your pointer defines only base class function if you declare in base clas... so in base class use virtual function... so that it will override.... then... you can use easily base class pointers in different class also...

Message permanent page

— Ah I missed that from the original question. Yes if it is in a catch block then execution will continue normally

Message permanent page