What is the output of the following C program?
#include <stdio.h>
int main(void) {
int value = 1;
const int *view = &value;
int *edit = &value;
*edit = 99;
printf("%d\n", *view);
return 0;
}
view and edit point to the same int. The const on view limits only what can be done through view; the object is not const, so writing through edit is perfectly legal.