Why the following C++ code does not give a segmentation fault, I am trying to access something that I have deleted.
#include <iostream>
using namespace std;
void fun ( int * ptr )
{
delete ptr;
}
int main ()
{
int * ptr = new int ;
*ptr = 6;
fun ( ptr );
cout<<*ptr;
return 0;
}