以下的问题是总结的我没回答上来或者回答的不好的小结,回答上来的被我省去了。
一个面试官面试了一个半小时,感觉这个面试官很nice,知识面比我广和深。踩了那么多雷,估计是没戏了!
各位看官,工作不好找,且好好珍惜当下的工作,记住:今天不努力工作,明天努力找工作!
1、为什么构造函数不能是虚函数?
关于C++为什么不支持虚拟构造函数,Bjarne很早以前就在C++Style and Technique FAQ里面做过回答
Avirtual call is a mechanism to get work done given partialinformation. In particular, "virtual" allows us to call afunction knowing only an interfaces and not the exact type of theobject. To create an object you need complete information. Inparticular, you need to know the exact type of what you want tocreate. Consequently, a "call to a constructor&#