The segmentation fault is a programming error, means the program is trying to access an invalid memory location or memory which does not exist.
See an example program of segmentation fault:
#include<stdio.h>
int main()
{
int *num;
/* This line will give segmentation fault */
/* Accessing pointer variable ‘num’ without allocating memory */
*num = 10;
return 0;
}
Output:
$ ./a.exe
Segmentation fault (core dumped)