1 2 3 4 5 6 7 8 9 10 11 12 13
int main() { char const *p = "abcdef"; char * const q = "uvwxyz"; char const * const r = "hijklmn"; p++; q++; r++; (*p)++; (*q)++; (*r)++; return 0; } /* end */
1 2 3 4 5
In function 'main': Line 6: error: increment of read-only variable 'q' Line 7: error: increment of read-only variable 'r' Line 8: error: increment of read-only location Line 10: error: increment of read-only location