Answer Posted / kamal
access to the memory which is not valid, will cause
segmentation fault.
Let us take example, in dynamic memory allocation like
malloc, we allocate memory and then we free it using:
free(fp);
if we write free() one more time say ,
free(fp);
free(fp);
it will cause segmentation fault. because the pointer was
already freed and now its not valid, but we are trying to
free an invalid location.
Is This Answer Correct ? | 74 Yes | 5 No |
Post New Answer View All Answers