编辑代码

#include <stdio.h>
int main () {
    // 指针是const 
    //表示一旦得到了某个变量的地址,不能再指向其他变量。
    int i =6;
    int *const q = &i;
    *q = 26;  //OK
    q++ ; // Error  不允许改变地址 -> q value

    // 所指是const
    // 表示不能通过这个指针去修改那个变量(并不是说 所指变量成为了const)
    const int *p = &i;
    *p = 26;//Error (*p)是const
    i= 26;//OK
    int j = 2;
    p = &j;//OK
    

    return 0;
}