My question is why does the value of variable a changes, although I've declared it as const? Sorry if this is a trivial question.
const int a = 8;
int* ptr = &a;
printf("variable: %d \n", a);
printf("pointer: %d \n", *ptr);
*ptr = 1;
printf("pointer: %d \n", *ptr);
printf("variable: %d \n", a);
Output: 8 8 1 1
Thanks and have a nice day!