05 2019 档案

摘要:操作系统装载程序之后,首先运行的代码并不是main的第一行,而是某些别的代码,这些代码负责准备好main函数执行所需要的环境,并且负责调用main函数,这时候你才可以在main函数里放心大胆地写各种代码:申请内存、使用系统调用、触发异常、访问I/O。 一个典型的程序运行步骤大致如下: (1)操作系统 阅读全文

posted @ 2019-05-27 16:51 EMH1899

摘要:pthread_join和pthread_detach的用法 pthread_join和pthread_detach的用法 //从别处拷贝过来的,只作为自己查看方便,原作者不详,请谅解。 一:关于join join join是三种同步线程的方式之一。另外两种分别是互斥锁(mutex)和条件变量(co 阅读全文

posted @ 2019-05-18 08:53 EMH1899

摘要:What is a Thread? A thread is a single sequence stream within in a process. Because threads have some of the properties of processes, they are sometim 阅读全文

posted @ 2019-05-14 20:15 EMH1899

摘要:A process which has finished the execution but still has entry in the process table to report to its parent process is known as a zombie process. A ch 阅读全文

posted @ 2019-05-13 14:37 EMH1899

摘要:fgetc() and fputc() in C fgetc() fgetc() is used to obtain input from a file single character at a time. This function returns the number of character 阅读全文

posted @ 2019-05-10 20:39 EMH1899

摘要: 阅读全文

posted @ 2019-05-10 15:33 EMH1899

摘要: 阅读全文

posted @ 2019-05-09 15:40 EMH1899

摘要:the hardware, the operating system, the application programs, and the users(四部分:硬件、操作系统、应用程序和用户) 10 Chapter 1 Introduction All forms of memory provide 阅读全文

posted @ 2019-05-09 10:32 EMH1899

摘要: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 阅读(200) 评论(0) 推荐(0)

摘要: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 阅读(183) 评论(0) 推荐(0)

摘要: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

摘要: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

摘要: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

摘要: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

摘要: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

摘要: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

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

posted @ 2019-05-02 17:18 EMH1899

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

posted @ 2019-05-01 20:19 EMH1899

导航