#include <iostream> using namespace std; int main() { const int * ptr; int x = 5; ptr = &x; *ptr = 3; return 0; }
Standard input is empty
prog.cpp: In function 'int main()': prog.cpp:8:7: error: assignment of read-only location '* ptr' *ptr = 3; ^
Standard output is empty