// test_const.cpp pointer and value constant and non constant int main() { int i1 = 1; int i2 = 2; int i3 = 3; int i5 = 5; const int ic = 9; // variable 'ic' unchangable // naming is pointer_object // con for constant // var for variable (not const) // four cases are possible: int * var_var; int * const con_var = &i1; // requires initialization const int * var_con; const int * const con_con = &i5; // requires initialization var_var = &i2; // con_var = &i2; // not allowed var_con = &i3; // con_con = &i2; // not allowed *var_var = 7; *con_var = 8; // *var_con = 7; // not allowed // *con_con = 7; // not allowed // var_var = ⁣ // not allowed // con_var = ⁣ // not allowed var_con = ⁣ // con_con = ⁣ // not allowed return 0; }