Merge pull request #92 from AkaShark/main

Update memory.md
This commit is contained in:
Ruan YiFeng
2023-05-18 12:31:22 +08:00
committed by GitHub

View File

@@ -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;