2019年5月8日

摘要: g++ -g -std=c++11 -m32 Test3.cpp -o Test3 注意这里是编的32位程序,如果编64位程序需要修改虚函数指针的偏移以及mem1和mem2的偏移 这是指向第一个虚函数的指针: (gdb) p /x *0xffffcaa0$5 = 0x8048b48 第一个虚函数的地 阅读全文
posted @ 2019-05-08 11:20 EMH1899 阅读(180) 评论(0) 推荐(0) 编辑

2019年5月7日

摘要: Exception Handling in C++ One of the advantages of C++ over C is Exception Handling. Exceptions are run-time anomalies or abnormal conditions that a p 阅读全文
posted @ 2019-05-07 15:42 EMH1899 阅读(165) 评论(0) 推荐(0) 编辑

2019年5月6日

摘要: 12.5 — The virtual table 12.5 — The virtual table BY ALEX ON FEBRUARY 8TH, 2008 | LAST MODIFIED BY ALEX ON SEPTEMBER 24TH, 2018 To implement virtual f 阅读全文
posted @ 2019-05-06 14:37 EMH1899 阅读(342) 评论(0) 推荐(0) 编辑

2019年5月4日

摘要: Predict the output of following C++ program: Output: The above program calls only B’s constructor, it doesn’t call A’s constructor. The reason for thi 阅读全文
posted @ 2019-05-04 18:10 EMH1899 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Object oriented design started right from the moment computers were invented. Programming was there, and programming approaches came into the picture. 阅读全文
posted @ 2019-05-04 16:12 EMH1899 阅读(316) 评论(0) 推荐(0) 编辑
摘要: malloc() vs new Following are the differences between malloc() and operator new.: Calling Constructors: new calls constructors, while malloc() does no 阅读全文
posted @ 2019-05-04 09:31 EMH1899 阅读(204) 评论(0) 推荐(0) 编辑

2019年5月3日

摘要: References vs PointersBoth references and pointers can be used to change local variables of one function inside another function. Both of them can als 阅读全文
posted @ 2019-05-03 16:46 EMH1899 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Can we make copy constructor private?Yes, a copy constructor can be made private. When we make a copy constructor private in a class, objects of that 阅读全文
posted @ 2019-05-03 16:15 EMH1899 阅读(289) 评论(0) 推荐(0) 编辑

2019年5月2日

摘要: 内存管理是C++最令人切齿痛恨的问题,也是C++最有争议的问题,C++高手从中获得了更好的性能,更大的自由,C++菜鸟的收获则是一遍一遍的检查代码和对C++的痛恨,但内存管理在C++中无处不在,内存泄漏几乎在每个C++程序中都会发生,因此要想成为C++高手,内存管理一关是必须要过的,除非放弃C++, 阅读全文
posted @ 2019-05-02 17:18 EMH1899 阅读(201) 评论(0) 推荐(0) 编辑

2019年5月1日

摘要: JNI 调用构造方法和父类实例方法 在前面我们学习到了在 Native 层如何调用 Java 静态方法和实例方法,其中调用实例方法的示例代码中也提到了调用构造函数来实始化一个对象,但没有详细介绍,一带而过了。还没有阅读过的同学请移步《JNI——C/C++ 访问 Java 实例方法和静态方法》阅读。这 阅读全文
posted @ 2019-05-01 20:19 EMH1899 阅读(295) 评论(0) 推荐(0) 编辑

导航