why do you get a segmentation fault in code example
Example: segmentation fault
A segmentation fault (aka segfault) is a common condition that causes programs
to crash; they are often associated with a file named core.
Segfaults are caused by a program trying to read or write an illegal memory
location