Compiling the following program
int main(void) {
int const c[2];
c[0] = 0;
c[1] = 1;
}
leads to error: assignment of read-only location ‘c[0]’. As I understand it, the const only applies to the location of c and so c[0] and c[1] should be mutable. Why is this error produced?
const.int (*const c)[10];*c[1] = 5;