用一个实例代码来记录一下使用const定义的变量可以怎样赋值
#include <stdio.h>
int main()
{
int b = 10;
const int a = b;
int const c = b;
a = 10; //error, con't modify read-only.
c = 11; //error, con't modify read-only.
const int *e = &b; //*e is const, but e is not read-only.
int f = 20;
*e=13; //error, con't modify read-only.
e= &f; //ok.
int * const g = &b; //g is const, but *g is not read-only.
*g = 21;//ok
g = &f; //error.
return 0;
}