菜单 学习猿地 - LMONKEY

VIP

开通学习猿地VIP

尊享10项VIP特权 持续新增

知识通关挑战

打卡带练!告别无效练习

接私单赚外块

VIP优先接,累计金额超百万

学习猿地私房课免费学

大厂实战课仅对VIP开放

你的一对一导师

每月可免费咨询大牛30次

领取更多软件工程师实用特权

入驻
234
0

C/C++ 中的指针

原创
05/13 14:22
阅读数 49366

指针(pointer)有两种涵义

一是指C/C++中的一种数据类型(data type)。

二是指某个类型为指针的 数据/物件(object)。

指针作为一种数据类型,属所谓复合类型(compound types)。

若非特别指明,下文中所言的指针皆为第二种涵义。

A compound type is a type that is defined in terms of another type. A pointer is a compound type that "points to" another type. Pointers are used for indirect access of other objects. A pointer is an object in its own right. A pointer holds the address of another object.

 

Pointer Values

The value (i.e., the address) stored in a pointer can be in one of four states:

1. It can point to an object

2. It can point to the location just immediately past the end of an object

3. It can be a null pointer, indicating that it is not bound to any object

4. It can be invalid; values other than the preceeding three are invalid

 

相关热门文章

发表评论

0/200
234 点赞
0 评论
收藏
为你推荐 换一批