笔记

2 篇文章
const使用.md

const使用.md

在C语言中,const关键字可以用于指针类型的声明中,它用于指定指针所指向的数据是常量,即该数据不能被修改。下面是一个使用const指针的示例代码:int main(){ const int x = 10; const int *ptr = &x; *ptr = 20;