const test。docker(136)

```c:const.c
#include <stdio.h>
#define PR(a) printf("%" #a " = " , a)

int main(){

int hoge1=1;
int * hoge2;
int * const hoge3;
const int * hoge4;
int const * hoge5;
const int * const hoge6;
const int const * hoge7;

hoge2= &hoge1;
hoge3 = &hoge1;
hoge4 = &hoge1;
hoge5 = &hoge1;
hoge6 = &hoge1;
PR(hoge1);
PR(hoge2);
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);

hoge3 = &hoge2;
hoge4 = &hoge2;
hoge5 = &hoge2;
hoge6 = &hoge2;
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
hoge4 = &hoge3;
hoge5 = &hoge3;
hoge6 = &hoge3;
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
hoge3 = &hoge4;
hoge5 = &hoge4;
hoge6 = &hoge4;
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
hoge3 = &hoge5;
hoge4 = &hoge5;
hoge6 = &hoge5;
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
hoge3 = &hoge6;
hoge4 = &hoge6;
hoge5 = &hoge6;

PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
}
```
compile

```shell_session:docker/ubuntu
# gcc const.c
const.c: In function 'main':
const.c:15:7: error: assignment of read-only variable 'hoge3'
   15 | hoge3 = &hoge1;
      |       ^
const.c:18:7: error: assignment of read-only variable 'hoge6'
   18 | hoge6 = &hoge1;
      |       ^
const.c:26:7: error: assignment of read-only variable 'hoge3'
   26 | hoge3 = &hoge2;
      |       ^
const.c:27:7: warning: assignment to 'const int *' from incompatible pointer type 'int **' [-Wincompatible-pointer-types]
   27 | hoge4 = &hoge2;
      |       ^
const.c:28:7: warning: assignment to 'const int *' from incompatible pointer type 'int **' [-Wincompatible-pointer-types]
   28 | hoge5 = &hoge2;
      |       ^
const.c:29:7: error: assignment of read-only variable 'hoge6'
   29 | hoge6 = &hoge2;
      |       ^
const.c:34:7: warning: assignment to 'const int *' from incompatible pointer type 'int * const*' [-Wincompatible-pointer-types]
   34 | hoge4 = &hoge3;
      |       ^
const.c:35:7: warning: assignment to 'const int *' from incompatible pointer type 'int * const*' [-Wincompatible-pointer-types]
   35 | hoge5 = &hoge3;
      |       ^
const.c:36:7: error: assignment of read-only variable 'hoge6'
   36 | hoge6 = &hoge3;
      |       ^
const.c:41:7: error: assignment of read-only variable 'hoge3'
   41 | hoge3 = &hoge4;
      |       ^
const.c:42:7: warning: assignment to 'const int *' from incompatible pointer type 'const int **' [-Wincompatible-pointer-types]
   42 | hoge5 = &hoge4;
      |       ^
const.c:43:7: error: assignment of read-only variable 'hoge6'
   43 | hoge6 = &hoge4;
      |       ^
const.c:48:7: error: assignment of read-only variable 'hoge3'
   48 | hoge3 = &hoge5;
      |       ^
const.c:49:7: warning: assignment to 'const int *' from incompatible pointer type 'const int **' [-Wincompatible-pointer-types]
   49 | hoge4 = &hoge5;
      |       ^
const.c:50:7: error: assignment of read-only variable 'hoge6'
   50 | hoge6 = &hoge5;
      |       ^
const.c:55:7: error: assignment of read-only variable 'hoge3'
   55 | hoge3 = &hoge6;
      |       ^
const.c:56:7: warning: assignment to 'const int *' from incompatible pointer type 'const int * const*' [-Wincompatible-pointer-types]
   56 | hoge4 = &hoge6;
      |       ^
const.c:57:7: warning: assignment to 'const int *' from incompatible pointer type 'const int * const*' [-Wincompatible-pointer-types]
   57 | hoge5 = &hoge6;
      |       ^
```

```c:const2.c

#include <stdio.h>
#define PR(a) printf("%" #a " = " , a)

int main(){

int hoge1=1;
int * hoge2;
int * const hoge3=&hoge1;
const int * hoge4;
int const * hoge5;
const int * const hoge6=&hoge3;
const int const * hoge7;

hoge2= &hoge1;
hoge4 = &hoge1;
hoge5 = &hoge1;
hoge7 = &hoge1;
PR(hoge1);
PR(hoge2);
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);

hoge4 = &hoge2;
hoge5 = &hoge2;
hoge7 = &hoge2;
PR(hoge2);
PR(hoge4);
PR(hoge5);
PR(hoge7);
hoge2 = &hoge3;
hoge4 = &hoge3;
hoge5 = &hoge3;
hoge7 = &hoge3;
PR(hoge2);
PR(hoge4);
PR(hoge5);
PR(hoge7);
hoge2 = &hoge4;
hoge5 = &hoge4;
hoge7 = &hoge4;
PR(hoge2);
PR(hoge5);
PR(hoge7);
hoge2 = &hoge5;
hoge4 = &hoge5;
hoge7 = &hoge5;
PR(hoge2);
PR(hoge4);
PR(hoge7);
hoge2 = &hoge6;
hoge4 = &hoge6;
hoge5 = &hoge6;
hoge7 = &hoge6;
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
hoge2 = &hoge7;
hoge4 = &hoge7;
hoge5 = &hoge7;
PR(hoge2);
PR(hoge4);
PR(hoge5);
}
```
compile

```shell_session:docker/ubuntu
# gcc const2.c
const2.c: In function 'main':
const2.c:11:25: warning: initialization of 'const int * const' from incompatible pointer type 'int * const*' [-Wincompatible-pointer-types]
   11 | const int * const hoge6=&hoge3;
      |                         ^
const2.c:25:7: warning: assignment to 'const int *' from incompatible pointer type 'int **' [-Wincompatible-pointer-types]
   25 | hoge4 = &hoge2;
      |       ^
const2.c:26:7: warning: assignment to 'const int *' from incompatible pointer type 'int **' [-Wincompatible-pointer-types]
   26 | hoge5 = &hoge2;
      |       ^
const2.c:27:7: warning: assignment to 'const int *' from incompatible pointer type 'int **' [-Wincompatible-pointer-types]
   27 | hoge7 = &hoge2;
      |       ^
const2.c:32:7: warning: assignment to 'int *' from incompatible pointer type 'int * const*' [-Wincompatible-pointer-types]
   32 | hoge2 = &hoge3;
      |       ^
const2.c:33:7: warning: assignment to 'const int *' from incompatible pointer type 'int * const*' [-Wincompatible-pointer-types]
   33 | hoge4 = &hoge3;
      |       ^
const2.c:34:7: warning: assignment to 'const int *' from incompatible pointer type 'int * const*' [-Wincompatible-pointer-types]
   34 | hoge5 = &hoge3;
      |       ^
const2.c:35:7: warning: assignment to 'const int *' from incompatible pointer type 'int * const*' [-Wincompatible-pointer-types]
   35 | hoge7 = &hoge3;
      |       ^
const2.c:40:7: warning: assignment to 'int *' from incompatible pointer type 'const int **' [-Wincompatible-pointer-types]
   40 | hoge2 = &hoge4;
      |       ^
const2.c:41:7: warning: assignment to 'const int *' from incompatible pointer type 'const int **' [-Wincompatible-pointer-types]
   41 | hoge5 = &hoge4;
      |       ^
const2.c:42:7: warning: assignment to 'const int *' from incompatible pointer type 'const int **' [-Wincompatible-pointer-types]
   42 | hoge7 = &hoge4;
      |       ^
const2.c:46:7: warning: assignment to 'int *' from incompatible pointer type 'const int **' [-Wincompatible-pointer-types]
   46 | hoge2 = &hoge5;
      |       ^
const2.c:47:7: warning: assignment to 'const int *' from incompatible pointer type 'const int **' [-Wincompatible-pointer-types]
   47 | hoge4 = &hoge5;
      |       ^
const2.c:48:7: warning: assignment to 'const int *' from incompatible pointer type 'const int **' [-Wincompatible-pointer-types]
   48 | hoge7 = &hoge5;
      |       ^
const2.c:52:7: warning: assignment to 'int *' from incompatible pointer type 'const int * const*' [-Wincompatible-pointer-types]
   52 | hoge2 = &hoge6;
      |       ^
const2.c:53:7: warning: assignment to 'const int *' from incompatible pointer type 'const int * const*' [-Wincompatible-pointer-types]
   53 | hoge4 = &hoge6;
      |       ^
const2.c:54:7: warning: assignment to 'const int *' from incompatible pointer type 'const int * const*' [-Wincompatible-pointer-types]
   54 | hoge5 = &hoge6;
      |       ^
const2.c:55:7: warning: assignment to 'const int *' from incompatible pointer type 'const int * const*' [-Wincompatible-pointer-types]
   55 | hoge7 = &hoge6;
      |       ^
const2.c:60:7: warning: assignment to 'int *' from incompatible pointer type 'const int **' [-Wincompatible-pointer-types]
   60 | hoge2 = &hoge7;
      |       ^
const2.c:61:7: warning: assignment to 'const int *' from incompatible pointer type 'const int **' [-Wincompatible-pointer-types]
   61 | hoge4 = &hoge7;
      |       ^
const2.c:62:7: warning: assignment to 'const int *' from incompatible pointer type 'const int **' [-Wincompatible-pointer-types]
   62 | hoge5 = &hoge7;
      |       ^
```

```c:const3.c

#include <stdio.h>
#define PR(a) printf("%" #a " = " , a,¥n)

int main(){

int hoge1=1;
int * hoge2;
int * const hoge3=&hoge1;
const int * hoge4;
int const * hoge5;
const int * const hoge6=hoge3;
const int const * hoge7;

hoge2= &hoge1;
hoge4 = &hoge1;
hoge5 = &hoge1;
hoge7 = &hoge1;
PR(hoge1);
PR(hoge2);
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);

hoge4 = hoge2;
hoge5 = hoge2;
hoge7 = hoge2;
PR(hoge4);
PR(hoge5);
PR(hoge7);
hoge2 = hoge3;
hoge4 = hoge3;
hoge5 = hoge3;
hoge7 = hoge3;
PR(hoge2);
PR(hoge4);
PR(hoge5);
PR(hoge7);
hoge2 = hoge4;
hoge5 = hoge4;
hoge7 = hoge4;
PR(hoge2);
PR(hoge5);
PR(hoge7);
hoge2 = hoge5;
hoge4 = hoge5;
hoge7 = hoge5;
PR(hoge2);
PR(hoge4);
PR(hoge7);
hoge2 = hoge6;
hoge4 = hoge6;
hoge5 = hoge6;
hoge7 = hoge6;
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
hoge2 = hoge7;
hoge4 = hoge7;
hoge5 = hoge7;
PR(hoge2);
PR(hoge4);
PR(hoge5);
}
```


```shell_session:docker/ubuntu
# gcc const3.c
const3.c: In function 'main':
const3.c:39:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   39 | hoge2 = hoge4;
      |       ^
const3.c:45:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   45 | hoge2 = hoge5;
      |       ^
const3.c:51:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   51 | hoge2 = hoge6;
      |       ^
const3.c:59:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   59 | hoge2 = hoge7;
      |       ^
```

```c:const4.c

#include <stdio.h>
#define PR(a) printf( #a " = %d \n',a)

int main(){

int hoge1=1;
int * hoge2;
int * const hoge3=&hoge1;
const int * hoge4;
int const * hoge5;
const int * const hoge6=hoge3;
const int const * hoge7;

hoge2= &hoge1;
hoge4 = &hoge1;
hoge5 = &hoge1;
hoge7 = &hoge1;
PR(hoge1);
PR(hoge2);
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);

hoge4 = hoge2;
hoge5 = hoge2;
hoge7 = hoge2;
PR(hoge4);
PR(hoge5);
PR(hoge7);
hoge2 = hoge3;
hoge4 = hoge3;
hoge5 = hoge3;
hoge7 = hoge3;
PR(hoge2);
PR(hoge4);
PR(hoge5);
PR(hoge7);
hoge2 = hoge4;
hoge5 = hoge4;
hoge7 = hoge4;
PR(hoge2);
PR(hoge5);
PR(hoge7);
hoge2 = hoge5;
hoge4 = hoge5;
hoge7 = hoge5;
PR(hoge2);
PR(hoge4);
PR(hoge7);
hoge2 = hoge6;
hoge4 = hoge6;
hoge5 = hoge6;
hoge7 = hoge6;
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
hoge2 = hoge7;
hoge4 = hoge7;
hoge5 = hoge7;
PR(hoge2);
PR(hoge4);
PR(hoge5);
}
```

```shell_session:docker/ubuntu
# gcc const4.c
const3.c: In function 'main':
const3.c:39:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   39 | hoge2 = hoge4;
      |       ^
const3.c:45:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   45 | hoge2 = hoge5;
      |       ^
const3.c:51:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   51 | hoge2 = hoge6;
      |       ^
const3.c:59:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   59 | hoge2 = hoge7;
      |       ^
root@b3af5df58ca0:/# ./a.out
hoge1 = 1 
hoge2 = 674864636 
hoge3 = 674864636 
hoge4 = 674864636 
hoge5 = 674864636 
hoge6 = 674864636 
hoge4 = 674864636 
hoge5 = 674864636 
hoge7 = 674864636 
hoge2 = 674864636 
hoge4 = 674864636 
hoge5 = 674864636 
hoge7 = 674864636 
hoge2 = 674864636 
hoge5 = 674864636 
hoge7 = 674864636 
hoge2 = 674864636 
hoge4 = 674864636 
hoge7 = 674864636 
hoge3 = 674864636 
hoge4 = 674864636 
hoge5 = 674864636 
hoge6 = 674864636 
hoge2 = 674864636 
hoge4 = 674864636 
hoge5 = 674864636
```

```c:const5.c
#include <stdio.h>
#define PR(a) printf( #a " = %d \n',a)

int main(){

int hoge1=1;
int * hoge2;
int * const hoge3=&hoge1;
const int * hoge4;
int const * hoge5;
const int * const hoge6=hoge3-2;
const int const * hoge7;

hoge2= &hoge1-1;
hoge4 = &hoge1+1;
hoge5 = &hoge1+2;
hoge7 = &hoge1+3;
PR(hoge1);
PR(hoge2);
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);

hoge4 = hoge2;
hoge5 = hoge2;
hoge7 = hoge2;
PR(hoge4);
PR(hoge5);
PR(hoge7);
hoge2 = hoge3;
hoge4 = hoge3;
hoge5 = hoge3;
hoge7 = hoge3;
PR(hoge2);
PR(hoge4);
PR(hoge5);
PR(hoge7);
hoge2 = hoge4;
hoge5 = hoge4;
hoge7 = hoge4;
PR(hoge2);
PR(hoge5);
PR(hoge7);
hoge2 = hoge5;
hoge4 = hoge5;
hoge7 = hoge5;
PR(hoge2);
PR(hoge4);
PR(hoge7);
hoge2 = hoge6;
hoge4 = hoge6;
hoge5 = hoge6;
hoge7 = hoge6;
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
hoge2 = hoge7;
hoge4 = hoge7;
hoge5 = hoge7;
PR(hoge2);
PR(hoge4);
PR(hoge5);
}
```

```shell_session:docker/ubuntu
# gcc const5.c
const5.c: In function 'main':
const5.c:39:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   39 | hoge2 = hoge4;
      |       ^
const5.c:45:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   45 | hoge2 = hoge5;
      |       ^
const5.c:51:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   51 | hoge2 = hoge6;
      |       ^
const5.c:59:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   59 | hoge2 = hoge7;
      |       ^
root@b3af5df58ca0:/# ./a.out
hoge1 = 1 
hoge2 = -1928507144 
hoge3 = -1928507140 
hoge4 = -1928507136 
hoge5 = -1928507132 
hoge6 = -1928507148 
hoge4 = -1928507144 
hoge5 = -1928507144 
hoge7 = -1928507144 
hoge2 = -1928507140 
hoge4 = -1928507140 
hoge5 = -1928507140 
hoge7 = -1928507140 
hoge2 = -1928507140 
hoge5 = -1928507140 
hoge7 = -1928507140 
hoge2 = -1928507140 
hoge4 = -1928507140 
hoge7 = -1928507140 
hoge3 = -1928507140 
hoge4 = -1928507148 
hoge5 = -1928507148 
hoge6 = -1928507148 
hoge2 = -1928507148 
hoge4 = -1928507148 
hoge5 = -1928507148 
```

```c:const7.c
#include <stdio.h>
#define PR(a) printf( #a " = %d \n",a)

int main(){

int hoge1=1;
int * hoge2;
int * const hoge3=&hoge1;
const int * hoge4;
int const * hoge5;
const int * const hoge6=hoge3-2;
const int const * hoge7;

hoge2= &hoge1-1;
hoge4 = &hoge1+1;
hoge5 = &hoge1+2;
hoge7 = &hoge1+3;
PR(hoge1);
PR(hoge2);
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
PR(hoge7);
PR(*hoge2);
PR(*hoge3);
PR(*hoge4);
PR(*hoge5);
PR(*hoge6);
PR(*hoge7);
hoge4 = hoge2;
hoge5 = hoge2;
hoge7 = hoge2;
PR(hoge4);
PR(hoge5);
PR(hoge7);
PR(*hoge4);
PR(*hoge5);
PR(*hoge7);
hoge2 = hoge3;
hoge4 = hoge3;
hoge5 = hoge3;
hoge7 = hoge3;
PR(hoge2);
PR(hoge4);
PR(hoge5);
PR(hoge7);
PR(*hoge2);
PR(*hoge4);
PR(*hoge5);
PR(*hoge7);
hoge2 = hoge4;
hoge5 = hoge4;
hoge7 = hoge4;
PR(hoge2);
PR(hoge5);
PR(hoge7);
PR(*hoge2);
PR(*hoge5);
PR(*hoge7);
hoge2 = hoge5;
hoge4 = hoge5;
hoge7 = hoge5;
PR(hoge2);
PR(hoge4);
PR(hoge7);
PR(*hoge2);
PR(*hoge4);
PR(*hoge7);
hoge2 = hoge6;
hoge4 = hoge6;
hoge5 = hoge6;
hoge7 = hoge6;
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
PR(*hoge3);
PR(*hoge4);
PR(*hoge5);
PR(*hoge7);
hoge2 = hoge7;
hoge4 = hoge7;
hoge5 = hoge7;
PR(hoge2);
PR(hoge4);
PR(hoge5);
PR(*hoge2);
PR(*hoge4);
PR(*hoge5);
}
```


```shell-session:docker/ubuntu
# gcc const7.c
const7.c: In function 'main':
const7.c:52:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   52 | hoge2 = hoge4;
      |       ^
const7.c:61:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   61 | hoge2 = hoge5;
      |       ^
const7.c:70:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   70 | hoge2 = hoge6;
      |       ^
const7.c:82:7: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   82 | hoge2 = hoge7;
      |       ^
root@b3af5df58ca0:/# ./c.out
bash: ./c.out: No such file or directory
root@b3af5df58ca0:/# ./a.out
hoge1 = 1 
hoge2 = 1240014920 
hoge3 = 1240014924 
hoge4 = 1240014928 
hoge5 = 1240014932 
hoge6 = 1240014916 
hoge7 = 1240014936 
*hoge2 = 4200213 
*hoge3 = 1 
*hoge4 = 1240014936 
*hoge5 = 32767 
*hoge6 = 0 
*hoge7 = 1240014932 
hoge4 = 1240014920 
hoge5 = 1240014920 
hoge7 = 1240014920 
*hoge4 = 4200213 
*hoge5 = 4200213 
*hoge7 = 4200213 
hoge2 = 1240014924 
hoge4 = 1240014924 
hoge5 = 1240014924 
hoge7 = 1240014924 
*hoge2 = 1 
*hoge4 = 1 
*hoge5 = 1 
*hoge7 = 1 
hoge2 = 1240014924 
hoge5 = 1240014924 
hoge7 = 1240014924 
*hoge2 = 1 
*hoge5 = 1 
*hoge7 = 1 
hoge2 = 1240014924 
hoge4 = 1240014924 
hoge7 = 1240014924 
*hoge2 = 1 
*hoge4 = 1 
*hoge7 = 1 
hoge3 = 1240014924 
hoge4 = 1240014916 
hoge5 = 1240014916 
hoge6 = 1240014916 
*hoge3 = 1 
*hoge4 = 0 
*hoge5 = 0 
*hoge7 = 0 
hoge2 = 1240014916 
hoge4 = 1240014916 
hoge5 = 1240014916 
*hoge2 = 0 
*hoge4 = 0 
*hoge5 = 0 
```

```cpp:const7.cpp
#include <stdio.h>
#define PR(a) printf( #a " = %d \n",a)

int main(){

int hoge1=1;
int * hoge2;
int * const hoge3=&hoge1;
const int * hoge4;
int const * hoge5;
const int * const hoge6=hoge3-2;
const int const * hoge7;

hoge2= &hoge1-1;
hoge4 = &hoge1+1;
hoge5 = &hoge1+2;
hoge7 = &hoge1+3;
PR(hoge1);
PR(hoge2);
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
PR(hoge7);
PR(*hoge2);
PR(*hoge3);
PR(*hoge4);
PR(*hoge5);
PR(*hoge6);
PR(*hoge7);
hoge4 = hoge2;
hoge5 = hoge2;
hoge7 = hoge2;
PR(hoge4);
PR(hoge5);
PR(hoge7);
PR(*hoge4);
PR(*hoge5);
PR(*hoge7);
hoge2 = hoge3;
hoge4 = hoge3;
hoge5 = hoge3;
hoge7 = hoge3;
PR(hoge2);
PR(hoge4);
PR(hoge5);
PR(hoge7);
PR(*hoge2);
PR(*hoge4);
PR(*hoge5);
PR(*hoge7);
hoge2 = hoge4;
hoge5 = hoge4;
hoge7 = hoge4;
PR(hoge2);
PR(hoge5);
PR(hoge7);
PR(*hoge2);
PR(*hoge5);
PR(*hoge7);
hoge2 = hoge5;
hoge4 = hoge5;
hoge7 = hoge5;
PR(hoge2);
PR(hoge4);
PR(hoge7);
PR(*hoge2);
PR(*hoge4);
PR(*hoge7);
hoge2 = hoge6;
hoge4 = hoge6;
hoge5 = hoge6;
hoge7 = hoge6;
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
PR(*hoge3);
PR(*hoge4);
PR(*hoge5);
PR(*hoge7);
hoge2 = hoge7;
hoge4 = hoge7;
hoge5 = hoge7;
PR(hoge2);
PR(hoge4);
PR(hoge5);
PR(*hoge2);
PR(*hoge4);
PR(*hoge5);
}
```

```
# g++ const7.cpp
const7.cpp: In function 'int main()':
const7.cpp:12:11: error: duplicate 'const'
   12 | const int const * hoge7;
      |           ^~~~~
      |           -----
const7.cpp:52:9: error: invalid conversion from 'const int*' to 'int*' [-fpermissive]
   52 | hoge2 = hoge4;
      |         ^~~~~
      |         |
      |         const int*
const7.cpp:61:9: error: invalid conversion from 'const int*' to 'int*' [-fpermissive]
   61 | hoge2 = hoge5;
      |         ^~~~~
      |         |
      |         const int*
const7.cpp:70:9: error: invalid conversion from 'const int*' to 'int*' [-fpermissive]
   70 | hoge2 = hoge6;
      |         ^~~~~
      |         |
      |         const int*
const7.cpp:82:9: error: invalid conversion from 'const int*' to 'int*' [-fpermissive]
   82 | hoge2 = hoge7;
      |         ^~~~~
      |         |
      |         const int*
const8.cpp:44:7: error: assignment of read-only variable 'hoge3'
   44 | hoge3 = hoge4;
      | ~~~~~~^~~~~~~
const8.cpp:50:7: error: assignment of read-only variable 'hoge3'
   50 | hoge3 = hoge5;
      | ~~~~~~^~~~~~~
const8.cpp:56:7: error: assignment of read-only variable 'hoge3'
   56 | hoge3 = hoge6;
      | ~~~~~~^~~~~~~
```

```
#include <stdio.h>
#define PR(a) printf( #a " = %d \n",a)

int main(){

int hoge1=1;
int * hoge2;
int * const hoge3=&hoge1;
const int * hoge4;
int const * hoge5;
const int * const hoge6=hoge3-2;
//const int const * hoge7;

hoge2= &hoge1-1;
hoge4 = &hoge1+1;
hoge5 = &hoge1+2;
//hoge7 = &hoge1+3;
PR(hoge1);
PR(hoge2);
PR(hoge3);
PR(hoge4);
PR(hoge5);
PR(hoge6);
PR(*hoge2);
PR(*hoge3);
PR(*hoge4);
PR(*hoge5);
PR(*hoge6);
hoge4 = hoge2;
hoge5 = hoge2;
PR(hoge4);
PR(hoge5);
PR(*hoge4);
PR(*hoge5);
hoge2 = hoge3;
hoge4 = hoge3;
hoge5 = hoge3;
PR(hoge2);
PR(hoge4);
PR(hoge5);
PR(*hoge2);
PR(*hoge4);
PR(*hoge5);
hoge5 = hoge4;
PR(hoge5);
PR(*hoge5);
hoge4 = hoge5;
PR(hoge4);
PR(*hoge4);
hoge4 = hoge6;
hoge5 = hoge6;
PR(hoge4);
PR(hoge5);
PR(hoge6);
PR(*hoge4);
PR(*hoge5);
}
```


```
# g++ const9.cpp
# ./a.out
hoge1 = 1 
hoge2 = 1182859008 
hoge3 = 1182859012 
hoge4 = 1182859016 
hoge5 = 1182859020 
hoge6 = 1182859004 
*hoge2 = 1585718576 
*hoge3 = 1 
*hoge4 = 1182859020 
*hoge5 = 32766 
*hoge6 = 0 
hoge4 = 1182859008 
hoge5 = 1182859008 
*hoge4 = 1585718576 
*hoge5 = 1585718576 
hoge2 = 1182859012 
hoge4 = 1182859012 
hoge5 = 1182859012 
*hoge2 = 1 
*hoge4 = 1 
*hoge5 = 1 
hoge5 = 1182859012 
*hoge5 = 1 
hoge4 = 1182859012 
*hoge4 = 1 
hoge4 = 1182859004 
hoge5 = 1182859004 
hoge6 = 1182859004 
*hoge4 = 0 
*hoge5 = 0 
```
#docker起動方法

```shell-session
$ docker run -it kaizenjapan/constc /bin/bash
```

<この項は書きかけです。順次追記します。>
This article is not completed. I will add some words and/or centences in order.
# 自己記事一覧
Qiitaで逆リンクを表示しなくなったような気がする。時々、スマフォで表示するとあらわっることがあり、完全に削除したのではなさそう。

４月以降、せっせとリンクリストを作り、統計を取って確率を説明しようとしている。
2025年２月末を目標にしている。

一覧の一覧( The directory of directories of mine.) Qiita(100)
https://qiita.com/kaizen_nagoya/items/7eb0e006543886138f39

仮説（0）一覧（目標100現在40）
https://qiita.com/kaizen_nagoya/items/f000506fe1837b3590df

Qiita(0)Qiita関連記事一覧（自分）
https://qiita.com/kaizen_nagoya/items/58db5fbf036b28e9dfa6

Error一覧 error(0)
https://qiita.com/kaizen_nagoya/items/48b6cbc8d68eae2c42b8

資料集 [あなたもdocker私もdocker一覧] docker(0) 
https://qiita.com/kaizen_nagoya/items/45699eefd62677f69c1d

C++ Support(0)　
https://qiita.com/kaizen_nagoya/items/8720d26f762369a80514

Coding(0) Rules, C, Secure, MISRA and so on
https://qiita.com/kaizen_nagoya/items/400725644a8a0e90fbb0

Ethernet 記事一覧　Ethernet(0)
https://qiita.com/kaizen_nagoya/items/88d35e99f74aefc98794

Wireshark 一覧 wireshark(0)、Ethernet(48) 
https://qiita.com/kaizen_nagoya/items/fbed841f61875c4731d0

線網（Wi-Fi）空中線(antenna)(0) 記事一覧(118/300目標)
https://qiita.com/kaizen_nagoya/items/5e5464ac2b24bd4cd001

なぜdockerで機械学習するか 書籍・ソース一覧作成中 (目標100)
https://qiita.com/kaizen_nagoya/items/ddd12477544bf5ba85e2

プログラムちょい替え（0）一覧:4件
https://qiita.com/kaizen_nagoya/items/296d87ef4bfd516bc394

言語処理100本ノックをdockerで。python覚えるのに最適。:10+12
https://qiita.com/kaizen_nagoya/items/7e7eb7c543e0c18438c4

Python(0)記事をまとめたい。
https://qiita.com/kaizen_nagoya/items/088c57d70ab6904ebb53

安全（0）安全工学シンポジウムに向けて: 21
https://qiita.com/kaizen_nagoya/items/c5d78f3def8195cb2409

プログラマによる、プログラマのための、統計(0)と確率のプログラミングとその後
https://qiita.com/kaizen_nagoya/items/6e9897eb641268766909

転職(0)一覧
https://qiita.com/kaizen_nagoya/items/f77520d378d33451d6fe

物理記事　上位100
https://qiita.com/kaizen_nagoya/items/66e90fe31fbe3facc6ff

量子(0) 計算機, 量子力学 
https://qiita.com/kaizen_nagoya/items/1cd954cb0eed92879fd4

数学関連記事１００
https://qiita.com/kaizen_nagoya/items/d8dadb49a6397e854c6d

統計(0)一覧
https://qiita.com/kaizen_nagoya/items/80d3b221807e53e88aba

図(0) state, sequence and timing. UML and お絵描き 
https://qiita.com/kaizen_nagoya/items/60440a882146aeee9e8f

品質一覧 
https://qiita.com/kaizen_nagoya/items/2b99b8e9db6d94b2e971

言語・文学記事　１００
https://qiita.com/kaizen_nagoya/items/42d58d5ef7fb53c407d6

医工連携関連記事一覧
https://qiita.com/kaizen_nagoya/items/6ab51c12ba51bc260a82

自動車　記事　１００
https://qiita.com/kaizen_nagoya/items/f7f0b9ab36569ad409c5

通信記事１００
https://qiita.com/kaizen_nagoya/items/1d67de5e1cd207b05ef7

日本語（０）一欄
https://qiita.com/kaizen_nagoya/items/7498dcfa3a9ba7fd1e68

英語(0) 一覧
https://qiita.com/kaizen_nagoya/items/680e3f5cbf9430486c7d


音楽　一覧(0) 
https://qiita.com/kaizen_nagoya/items/b6e5f42bbfe3bbe40f5d

「@kazuo_reve 新人の方によく展開している有益な情報」確認一覧 
https://qiita.com/kaizen_nagoya/items/b9380888d1e5a042646b

鉄道（０）鉄道のシステム考察はてっちゃんがてつだってくれる
https://qiita.com/kaizen_nagoya/items/faa4ea03d91d901a618a

OSEK OS設計の基礎　OSEK(100)
https://qiita.com/kaizen_nagoya/items/7528a22a14242d2d58a3

coding (101) 一覧を作成し始めた。omake:最近のQiitaで表示しない5つの事象
https://qiita.com/kaizen_nagoya/items/20667f09f19598aedb68

官公庁・学校・公的団体（NPOを含む）システムの課題、官（０）
https://qiita.com/kaizen_nagoya/items/04ee6eaf7ec13d3af4c3

「はじめての」シリーズ　 ベクタージャパン　
https://qiita.com/kaizen_nagoya/items/2e41634f6e21a3cf74eb

AUTOSAR(0)Qiita記事一覧, OSEK(75)
https://qiita.com/kaizen_nagoya/items/89c07961b59a8754c869

プログラマが知っていると良い「公序良俗」
https://qiita.com/kaizen_nagoya/items/9fe7c0dfac2fbd77a945

LaTeX(0) 一覧　
https://qiita.com/kaizen_nagoya/items/e3f7dafacab58c499792

自動制御、制御工学一覧（０）
https://qiita.com/kaizen_nagoya/items/7767a4e19a6ae1479e6b

Rust(0) 一覧　
https://qiita.com/kaizen_nagoya/items/5e8bb080ba6ca0281927

# 関連資料
' @kazuo_reve 私が効果を確認した「小川メソッド」
https://qiita.com/kazuo_reve/items/a3ea1d9171deeccc04da

' @kazuo_reve 新人の方によく展開している有益な情報
https://qiita.com/kazuo_reve/items/d1a3f0ee48e24bba38f1

' @kazuo_reve Vモデルについて勘違いしていたと思ったこと
https://qiita.com/kazuo_reve/items/46fddb094563bd9b2e1e


## Engineering Festa 2024前に必読記事一覧
programの本質は計画だ。programは設計だ。
https://qiita.com/kaizen_nagoya/items/c8545a769c246a458c27

登壇直後版 色使い(JIS安全色) Qiita Engineer Festa 2023〜私しか得しないニッチな技術でLT〜 スライド編 0.15
https://qiita.com/kaizen_nagoya/items/f0d3070d839f4f735b2b

プログラマが知っていると良い「公序良俗」
https://qiita.com/kaizen_nagoya/items/9fe7c0dfac2fbd77a945

逆も真：社会人が最初に確かめるとよいこと。OSEK(69)、Ethernet(59)
https://qiita.com/kaizen_nagoya/items/39afe4a728a31b903ddc

統計の嘘。仮説（127）
https://qiita.com/kaizen_nagoya/items/63b48ecf258a3471c51b

自分の言葉だけで論理展開できるのが天才なら、文章の引用だけで論理展開できるのが秀才だ。仮説（136）
https://qiita.com/kaizen_nagoya/items/97cf07b9e24f860624dd

参考文献駆動執筆(references driven writing)・デンソークリエイト編
https://qiita.com/kaizen_nagoya/items/b27b3f58b8bf265a5cd1

「何を」よりも「誰を」。１０年後のために今見習いたい人たち
https://qiita.com/kaizen_nagoya/items/8045978b16eb49d572b2

Qiitaの記事に３段階または５段階で到達するための方法
https://qiita.com/kaizen_nagoya/items/6e9298296852325adc5e

出力(output)と呼ばないで。これは状態(state)です。
https://qiita.com/kaizen_nagoya/items/80b8b5913b2748867840

coding (101) 一覧を作成し始めた。omake:最近のQiitaで表示しない5つの事象
https://qiita.com/kaizen_nagoya/items/20667f09f19598aedb68

あなたは「勘違いまとめ」から、勘違いだと言っていることが勘違いだといくつ見つけられますか。人間の間違い(human error(125))の種類と対策
https://qiita.com/kaizen_nagoya/items/ae391b77fffb098b8fb4

プログラマの「プログラムが書ける」思い込みは強みだ。３つの理由。仮説（168）統計と確率(17) , OSEK(79)
https://qiita.com/kaizen_nagoya/items/bc5dd86e414de402ec29

出力(output)と呼ばないで。これは状態(state)です。
https://qiita.com/kaizen_nagoya/items/80b8b5913b2748867840

これからの情報伝達手段の在り方について考えてみよう。炎上と便乗。
https://qiita.com/kaizen_nagoya/items/71a09077ac195214f0db

ISO/IEC JTC1 SC7 Software and System Engineering
https://qiita.com/kaizen_nagoya/items/48b43f0f6976a078d907

アクセシビリティの知見を発信しよう！（再び）
https://qiita.com/kaizen_nagoya/items/03457eb9ee74105ee618

統計論及確率論輪講（再び）
https://qiita.com/kaizen_nagoya/items/590874ccfca988e85ea3

読者の心をグッと惹き寄せる7つの魔法
https://qiita.com/kaizen_nagoya/items/b1b5e89bd5c0a211d862

「@kazuo_reve 新人の方によく展開している有益な情報」確認一覧
https://qiita.com/kaizen_nagoya/items/b9380888d1e5a042646b

ソースコードで議論しよう。日本語で議論するの止めましょう（あるプログラミング技術の議論報告）
https://qiita.com/kaizen_nagoya/items/8b9811c80f3338c6c0b0

脳内コンパイラの3つの危険
https://qiita.com/kaizen_nagoya/items/7025cf2d7bd9f276e382

心理学の本を読むよりはコンパイラ書いた方がよくね。仮説（34）
https://qiita.com/kaizen_nagoya/items/fa715732cc148e48880e

NASAを超えるつもりがあれば読んでください。
https://qiita.com/kaizen_nagoya/items/e81669f9cb53109157f6

データサイエンティストの気づき!「勉強して仕事に役立てない人。大嫌い!!」『それ自分かも?』ってなった!!! 
https://qiita.com/kaizen_nagoya/items/d85830d58d8dd7f71d07

「ぼくの好きな先生」「人がやらないことをやれ」プログラマになるまで。仮説（37）　
https://qiita.com/kaizen_nagoya/items/53e4bded9fe5f724b3c4

なぜ経済学徒を辞め、計算機屋になったか（経済学部入学前・入学後・卒業後対応） 転職(1)  
https://qiita.com/kaizen_nagoya/items/06335a1d24c099733f64    

プログラミング言語教育のXYZ。 仮説（52） 
https://qiita.com/kaizen_nagoya/items/1950c5810fb5c0b07be4

【24卒向け】9ヶ月後に年収１０００万円を目指す。二つの関門と三つの道。
https://qiita.com/kaizen_nagoya/items/fb5bff147193f726ad25

「【25卒向け】Qiita Career Meetup for STUDENT」予習の勧め
https://qiita.com/kaizen_nagoya/items/00eadb8a6e738cb6336f

大学入試不合格でも筆記試験のない大学に入って卒業できる。卒業しなくても博士になれる。
https://qiita.com/kaizen_nagoya/items/74adec99f396d64b5fd5

全世界の不登校の子供たち「博士論文」を書こう。世界子供博士論文遠隔実践中心 安全(99)
https://qiita.com/kaizen_nagoya/items/912d69032c012bcc84f2

小川メソッド　覚え（書きかけ）
https://qiita.com/kaizen_nagoya/items/3593d72eca551742df68

DoCAP（ドゥーキャップ）って何ですか？
https://qiita.com/kaizen_nagoya/items/47e0e6509ab792c43327

views 20,000越え自己記事一覧
https://qiita.com/kaizen_nagoya/items/58e8bd6450957cdecd81

Views１万越え、もうすぐ１万記事一覧 最近いいねをいただいた213記事
https://qiita.com/kaizen_nagoya/items/d2b805717a92459ce853

amazon 殿堂入りNo1レビュアになるまで。仮説(102)
https://qiita.com/kaizen_nagoya/items/83259d18921ce75a91f4

100以上いいねをいただいた記事16選
https://qiita.com/kaizen_nagoya/items/f8d958d9084ffbd15d2a

小川清最終講義、最終講義（再）計画, Ethernet(100) 英語(100) 安全(100)
https://qiita.com/kaizen_nagoya/items/e2df642e3951e35e6a53

＜この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。＞
This article is an individual impression based on my individual experience. It has nothing to do with the organization or business to which I currently belong.
### 文書履歴(document history)
ver. 0.01 初稿 　20241129
### 最後までおよみいただきありがとうございました。
いいね　💚、フォローをお願いします。
#### Thank you very much for reading to the last sentence.
Please press the like icon 💚　and follow me for your happy life.