函数指针的实现很简单:它们只是“代码指针(code pointer)”,它们体现在汇编语言中是用来保存子程序代码的首地址。而这种函数指针的存在只是为了保证使用了正确的调用规范。
基于22个网页-相关网页
此外,它并不指出在代码的何处这个空指针被赋值。
Furthermore, it says nothing about where in the code the null pointer was actually assigned.
此类错误的典型示例是添加错误处理代码以处理NULL指针或错误的引用,却没有查出无效引用的真正原因。
A classic example of such a mistake is adding error handling code to take care of NULL Pointers or bad references without looking into the real cause of the invalid references.
在Solaris,下面这段示例代码让您可以获取堆栈指针。
On Solaris, this sample code allows you to get the stack pointer.
> Okay. This code allocates two pointers which can point to integers.
>,好的,这段代码分配两个指针,可以指向整型数。
> Okay. Well, this code allocates a new integer pointee and this part sets x to point to it.
>,好的,呃,这段代码分配一个新的整型指针数据,这部分让x指向它。
应用推荐