Virtual Functions in C ++ 虚函数

先看看虚函数定义的:

A virtual function is so named because it may, be used before it is defined // 是函数的调用在定义之前,不是函数声明

late binding or dynamic binding(动态绑定)

When you make a function virtual , you are telling the compiler “I do not know how this function is implemented. Wait until it is used in a program, and then get
the implementation from the object instance.” The technique of waiting until run time to determine the implementation of a procedure is often called late binding or
dynamic binding//  先前不知道是怎么实现的,直到从对象里面调用这个函数

见absolute c++ 15章

posted on 2012-12-05 14:29  GIS-MAN  阅读(115)  评论(0编辑  收藏  举报

导航