CodePudding user response:
Modify, const just compiler class immutable, real memory read and write access is the related systemCodePudding user response:
Give you a piece of code, run once knowint main () {
Const int a []={1, 2};
Int * p=(int *) a;
//a [0]=2;
* p=2;
Printf (" % d \ n ", a [0]).
return 0;
}
CodePudding user response:
Will modify, not to give tips, because is xyz array of const modifiers, cannot pass xyz array to modify, but on the other variables (pointer) can be modified, not restricted, const modifiers are not read-only memory,