Identify the error (dangling pointer, Memory Leak,Stack/Heap issue)

  c++

Kindly provide with help regarding what is the issue with this piece of code

int meaning = 42;
int *life = &meaning;
int **universe = &life;
int ***everything = &universe;
cout << ***everything <<endl;
delete life;  //Breakpoint getting triggered
life = nullptr;
universe = nullptr;
everything = nullptr;

Source: Windows Questions C++

LEAVE A COMMENT