OPP Basic--if virtual functions are so powerful, can we declare all member functions virtual?

A:
Never. cos virtual functions has costs.  Each object of virtual function must have a v table to manage them.Therefore using virtual function will need system costs. for only a very small class and dont wanna derive other classes, then it's no need to use virtual functions  in this class at all.

posted on 2008-02-26 11:32  飞天舞者  阅读(182)  评论(0编辑  收藏  举报

导航

For more information about me, feel free email to me winston.he@hotmail.com