This code snippet:
int* fun()
{
  int t=10;
  int *pointer=&t;
  return pointer;
}
int main()
{
  int* p = fun()
  cout<<*p;
}
as the above variable t goes out of scope as the function call ends and pointer storing address of variable that does not exist gives no error and works properly....confused why why??
 
    