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