| What is segmentation fault? |
| Courtesy: Navdeep Singh | |
|
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. |
| < Prev | Next > |
|---|




