什么是NULL指针解除引用 [英] what is NULL pointer dereferencing

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

问题描述

我没有得到确切的想法。


你能用一个例子来解释我。


谢谢

I am not getting the exact idea.

Can you please explain me with an example.

Thanks

推荐答案

" pr **************** @ gmail.com"写道:
"pr****************@gmail.com" wrote:

>

我没有得到确切的想法。


你能来吗请举个例子来解释我。
>
I am not getting the exact idea.

Can you please explain me with an example.



请在文章正文中说明你的问题 - 谢谢。


NULL指针不是/ for / dereferencing 。将指针设置为

NULL表示指针未指向可用值

且不应取消引用。


-

Morris Dovey

DeSoto Solar

德索托,爱荷华州美国
http://www.iedu.com/DeSoto/


Morris Dovey写道:
Morris Dovey wrote:

" pr **************** @ gmail.com"写道:
"pr****************@gmail.com" wrote:

>>
我没有得到确切的想法。

你能用一个例子解释我吗? 。
>>
I am not getting the exact idea.

Can you please explain me with an example.



请在文章正文中说明你的问题 - 谢谢。


NULL指针不是/ for / dereferencing 。将指针设置为

NULL表示指针未指向可用值

且不应取消引用。


Please state your question in the body of your article - thanks.

A NULL pointer is not /for/ dereferencing. Setting a pointer to
NULL indicates that the pointer does not point to a usable value
and should not be dereferenced.



但是取消引用NULL指针比使用未初始化的指针或指向不再有效的

指针更好。

更好,因为更容易做到现场(probtram会在那里崩溃)和

调试(狩猎悬挂指针是众所周知的痛苦,因为程序

很可能在一个完全不相关的地方崩溃。)

所以有一个很好的理由(重新)初始化指向NULL的指针。


再见,Jojo

But is is better to dereference a NULL pointer than uninialized pointer or a
pointer that points to something that is no longer valid.
Better, because easier do spot (the probtram will crash right there) and to
debug (hunting dangling pointers is a pain in the proverbial, as the program
quite likely crashes at a totally unrelated place).
So there''s a good reason to (re-)initialize a pointer to NULL.

Bye, Jojo


Joachim Schmitz写道:
Joachim Schmitz wrote:

但最好是取消引用NULL指针而不是uninialized指针或

指针,指向不再有效的东西。

更好,因为更容易做点(probtram会在那里崩溃)和

调试(狩猎悬挂指针是众所周知的痛苦,因为程序

很可能在完全崩溃时崩溃ted place)。

所以有一个很好的理由(重新)初始化一个指向NULL的指针。
But is is better to dereference a NULL pointer than uninialized pointer or a
pointer that points to something that is no longer valid.
Better, because easier do spot (the probtram will crash right there) and to
debug (hunting dangling pointers is a pain in the proverbial, as the program
quite likely crashes at a totally unrelated place).
So there''s a good reason to (re-)initialize a pointer to NULL.



嗯 - 你准备_guarantee_取消引用null

指针会导致_every_系统崩溃,或者你是不是/>
进行一些一厢情愿的想法?


-

Morris Dovey

DeSoto Solar

美国爱荷华州DeSoto
http://www.iedu .com / DeSoto /


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

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