fork download
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';
}
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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]
stdout
Standard output is empty