int main()
{
char ch;
const char * a = &ch;
a = nullptr;
*a = '\0';
char * const b = &ch;
b = nullptr;
*b = '\0';
const char & d = ch;
d = '\0';
char & const e = ch;
char const & f = ch;
f = '\0';
}
aW50IG1haW4oKQp7CiAgICBjaGFyIGNoOwoKCWNvbnN0IGNoYXIgKiBhID0gJmNoOwoJYSA9IG51bGxwdHI7CgkqYSA9ICdcMCc7CgoJY2hhciAqIGNvbnN0IGIgPSAmY2g7CgliID0gbnVsbHB0cjsKCSpiID0gJ1wwJzsKCgljb25zdCBjaGFyICYgZCA9IGNoOwoJZCA9ICdcMCc7CgoJY2hhciAmIGNvbnN0IGUgPSBjaDsKCgljaGFyIGNvbnN0ICYgZiA9IGNoOwoJZiA9ICdcMCc7Cn0K
prog.cpp: In function ‘int main()’:
prog.cpp:7:7: error: assignment of read-only location ‘* a’
prog.cpp:10:6: error: assignment of read-only variable ‘b’
prog.cpp:14:6: error: assignment of read-only reference ‘d’
prog.cpp:16:15: error: ‘const’ qualifiers cannot be applied to ‘char&’
prog.cpp:19:6: error: assignment of read-only reference ‘f’
prog.cpp:16:15: warning: unused variable ‘e’ [-Wunused-variable]