摘要:
C++ 虚函数表解析(转) C++ 虚函数表解析前言C++中的虚函数的作用主要是实现了多态的机制。关于多态,简而言之就是用父类型别的指针指向其子类的实例,然后通过父类的指针调用实际子类的成员函数。这种技术可以让父类的指针有“多种形态”,这是一种泛型技术。所谓泛型技术,说白了就是试图使用不变的代码来实现可变的算法。比如:模板技术,RTTI技术,虚函数技术,要么是试图做到在编译... 阅读全文
摘要:
Question #49: What is the output of the program? 55% on 10074 times asked #include <iostream> class Foo { public: char c; static double sd; double d; int i; }; int main(int argc, char** argv) { ... 阅读全文
摘要:
Question #15: Which of the following functions are found when called in main during name lookup? 55% on 10310 times asked #include <iostream> namespace standards { struct datastructure { }; void... 阅读全文