CSE 278 Lecture Notes - Lecture 23: Virtual Method Table, Name Binding, Virtual Function
Document Summary
In any of the above, the compiler determines which version of the function or class to use. Method is determined at run time (dynamically) Dynamic binding happens at execution time, as with dynamic allocation. Example: the space allocated by p=new double[300], the value of pointer p is not determined until the statement is executed. Similarly the code for method func is now known until func is called. Read and write for i/o files and those used for sockets used the same functions and parameters. The os determined at runtime how to interpret. The idea of determined dynamically what method to use is called virtual functions in. C++ allows virtual function in a base class to be overridden, or redefined on a derived class. Functions can be defined altogether in the derived class too. These are known as pure virtual functions. There is a syntactic device to define them.