Fix: Segmentation fault (core dumped) in Linux / C / C++
How to fix the 'Segmentation fault (core dumped)' error in Linux, covering null pointer dereference, buffer overflow, use-after-free, stack overflow, and debugging with GDB, Valgrind, and AddressSanitizer.