what is segmentation fault?

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


Please Help Members By Posting Answers For Below Questions

I would like to know whether Simado and Setu products are they EPBX or not ?

1923


Explain process management system calls in linux?

536


What are system calls used for process management in linux?

577


what are different ways the context switch happens from user to kernel space or vice-versa ?

2131