Learn how to debug a segmentation fault (seg fault) error using tools like gdb and techniques like tracking the memory location.
The code I just gave - why is it seg faulting?