C语言指针(pointer),深入浅出,中英结合

指针|Pointer

a pointer is a variable that contains the address of a variable.
指针是一个变量,包含一个变量的地址的变量。

在正式学习指针之前,需要先理解指针与地址的关系,see 指针与地址的物理关系


& 取地址运算符

unary operator & gives the address of an object, so the statement

p = &c;

assigns the address of c to the variable p, and p is said to point to c.
The & operator only applies to objects in memory: variables and array elements.

ps.如果不能理解,可以看一下对赋值符号的理解,再回来

* 间接或解引用运算符

The unary operator * is the indirection or dereferencing operator; when applied to a pointer, it accesses the object the pointer point to.

declaration of pointer p,指针的声明

int *p; /* ip is a pointer to int */

指针与数组

指针与数组是密切相关的,因此讨论指针必须要讨论C指针与数组的关系

实例

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值