初学者对于const和常量指针的困惑

菜鸟对于const和常量指针的困惑!
const int a
代表a为常量,a的值不变

const int *a
我的理解:a的值不变
实际:*a不变

int * const a
常量指针。除了指针部分,未见这样的用法

我的理解应该是对于const、‘*’,位置的偏差
求解释
------解决思路----------------------
是不是这样,const 跟着什么,什么的值就不能变?
理不清楚初学者对于const和常量指针的困惑

下面是在百度搜索【int * const 】找到的

const int a; int const a; 这两个写法是等同的,表示a是一个int常量。
const int *a; 表示a是一个指针,可以任意指向int常量或者int变量,它总是把它所指向的目标当作一个int常量。也可以写成int const* a;含义相同。
int * const a; 表示a是一个指针常量,初始化的时候必须固定指向一个int变量,之后就不能再指向别的地方了。
int const * const a;表示a是一个指针常量,初始化的时候必须固定指向一个int常量或者int变量,之后就不能再指向别的地方了,它总是把它所指向的目标当作一个int常量。也可以写成const int* const a;含义相同。
------解决思路----------------------

root@jusse ~/develop# cat -n cc_const.c 
     1  #include <stdio.h>
     2
     3  int main(int argc, char *argv[])
     4  {
     5      int a = 10;
     6      int b = 20;
     7      const int *cpa = &a;
     8      int * const pca = &a;
     9      const int * const cpca = &a;
    10
    11      cpa = &b;
    12      *cpa = 30;
    13      pca = &b;
    14      *pca = 40;
    15      cpca = &b;
    16      *cpca = 50;
    17
    18      printf("a: %d, b: %d\n", a, b);
    19
    20      return 0;
    21  }

root@jusse ~/develop# gcc -Wall -g -o cc_const ./cc_const.c 
./cc_const.c: In function ‘main’:
./cc_const.c:12:5: error: assignment of read-only location ‘*cpa’
./cc_const.c:13:5: error: assignment of read-only variable ‘pca’
./cc_const.c:15:5: error: assignment of read-only variable ‘cpca’
./cc_const.c:16:5: error: assignment of read-only location ‘*cpca’

从上面代码你就可以知道哪个可以变哪个不能变了。
我是这么简单记的,const离哪个近哪个就不能变,比如const int *a,那么int不可变,int * const a,那么a不可变,const int * const,那么int和a都不可变。