I want to know how I am getting answer for the below code can anyone pls explain ..
In c language..
#include <stdio.h>
int*p;
void fun(int a, int b)
{
    int c;
    c = a+b ;
    p=&c;
}
int main()
{
    fun(2,3);
    printf("%d",*p);
    return 0;
}
If the pointer is declared globally how it's possible to access the memory that was collapsed after return to the main function
 
     
    