What is a segmentation fault anyway?
It may help at this point to know what a segmentation fault is. This is an oversimplified explanation, but it will do for our purposes: A segmentation fault occurs when: • you try to access a memory location that you are not supposed to access. Here’s a slightly more detailed explanation: • A segmentation fault has to do access to memory locations • By memory locations, we mean the computer’s short-term memory, or RAM (Random Access Memory) • This is the place where all variables and executable code are stored when a program is running. • Members of the general public sometimes use the word “memory” to refer to either RAM or disk space—but if you hear a computer scientist use the word “memory” all by itself, it usually refers to RAM and hardly ever refers to disk space. • Memory (RAM) is divided into segments, each with its own protection level • Some segments are “read-only” such as program code, or areas used for constants and string literals. • A running program should not modify th