#include
using namespace std;
int main() {
const int N = 22;
int * pN = const_cast(&N);
*pN = 33;
co
int * pN = const_cast(&N);
*pN = 33;
Your code invokes Undefined Behavior1 because you are modifying the content of a const qualified variable/object.
1) Undefined Behavior: Behavior, such as might arise upon use of an erroneous program construct or of erroneous data, for which the Standard imposes no requirements.[Note: permissible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment (with or without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message).