Please insert a code snippet in between free and usage That's what I can refer http://stackoverflow.com/questions/9124672/array-desctruction-at-the-end-of-funtion-call
On 2/25/12, AMAN AGARWAL <[email protected]> wrote: > Hi, > > int main() > { > int i; > > int*p=malloc(4); > *p=2; > printf("%d\n",*p); > free(p); > *p=5; > printf("%d\n",*p); > scanf("%d",&i); > return 0; > } > > Even though I have freed the memory using free(p) when I am dereferencing > it I dont get any seg fault. > Can anybody explain me why??? > > Regards, > Aman. > -- > AMAN AGARWAL > "Success is not final, Failure is not fatal: It is the courage to continue > that counts!" > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
