how to know where sementation fault occured code example
Example 1: segmentation fault
Segfaults are caused by a program trying to read or write an illegal memory location
Example 2: how to know where segfaut is c
$ gdb ./a.out
(gdb) run
(gdb) backtrace