mirror of
https://github.com/wangdoc/clang-tutorial.git
synced 2026-11-05 15:08:11 +08:00
@@ -234,7 +234,7 @@ int* restrict p;
|
|||||||
p = malloc(sizeof(int));
|
p = malloc(sizeof(int));
|
||||||
```
|
```
|
||||||
|
|
||||||
上面示例中,声明指针变量`p`时,加入了`restrict`说明符,使得`p`变成了受限指针。后面,当`p`指向`malloc()`函数返回的一块内存区域,就味着,该区域只有通过`p`来访问,不存在其他访问方式。
|
上面示例中,声明指针变量`p`时,加入了`restrict`说明符,使得`p`变成了受限指针。后面,当`p`指向`malloc()`函数返回的一块内存区域,就意味着,该区域只有通过`p`来访问,不存在其他访问方式。
|
||||||
|
|
||||||
```c
|
```c
|
||||||
int* restrict p;
|
int* restrict p;
|
||||||
|
|||||||
Reference in New Issue
Block a user