text 在C中取消引用指针

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 在C中取消引用指针相关的知识,希望对你有一定的参考价值。

Dereferencing the pointer: 

We go to the reference and we change the value at that address

For example:

char *pc;  // So 'pc' is a pointer that points to an address that stores a char.

If we do:
*pc = 'D';  // This is dereferencing the pointer 'pc'. So we go to the address where 'pc' points to, and we change the value in that address.

So here '*' is called dereference operator. It "goes to the reference" and access the data at that memory location, allowing you to manipulate it at will.

So the '*' helps you to go to that address, and change the value in that address or get the value that's stored there, or other things.

以上是关于text 在C中取消引用指针的主要内容,如果未能解决你的问题,请参考以下文章

C: Cppcheck : 可能的空点取消引用

当我们在 C 中取消引用 NULL 指针时,操作系统会发生啥?

在调用函数中取消引用指针时出现分段错误

在 Python/ctypes 中的结构内取消引用 C 函数指针

通过指针、强制转换和取消引用加载向量?

C错误 - 取消引用指向不完整类型的指针