Hi guys, just playing about with pointers and keywords and to my surprise, this code does not throw up an error... can anyone tell me why?
int main()
{
int *P = new int;
*P = 50;
cout << *P << endl; // output: 50
delete P;
*P = 4; // Isn't the pointer P now supposed to be dangling?
cout << *P << endl; // output: 4 (?!) Shouldn't this be an error?
}