解引用一个空指针 [英] Dereferencing a null pointer

查看:686
本文介绍了解引用一个空指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我无法提领一空指针?也就是说,我为什么不能读/写内存,地址仅仅是0?

Why I can't dereference a null pointer? That is, why I can't read/write memory which address is simply 0?

我的过程中的基指针有不同的地址?如果是的话,有没有办法获得适合我的过程中的默认堆?

Does the base pointer of my process have a different address? If yes, is there a way to obtain the lower memory adders available for the default heap of my process?

推荐答案

一个空指针不是指针,以记忆[其]地址只是0。这只是一个特殊的指针,不指向任何有效的。

A null pointer is not a pointer to "memory [whose] address is simply 0". It's just a special pointer that doesn't point to anything valid.

C语言说有上取消引用一个空指针程序的行为没有任何要求。

The C language says that there are no requirements on the behaviour of a program that dereferences a null pointer.

这篇关于解引用一个空指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆