C语言 const的使用
const 使用方法#include <stdio.h>const int a=10;/*const 使用的是全局变量进行赋值的时候, * 1. 如果直接对值进行赋值,会产生错误 * 2. 如果通过地址改变内容,会产生段错误 * */void test(){ printf("%d\n",a);// a=11;// printf("%d\n",a);// int *p=&a;// *p=100; printf("%d\n",a);}void tes
原创
2021-03-02 23:46:13 ·
172 阅读 ·
0 评论