Wikipedia has the answer, along with a number of other sources.
A segfault basically means you did something bad with pointers. This is probably a segfault:
char *c = NULL;
...
*c; // dereferencing a NULL pointer
Or this:
char *c = "Hello";
...
c[10] = 'z'; // out of bounds, or in this case, writing into read-only memory
Or maybe this:
char *c = new char[10];
...
delete [] c;
...
c[2] = 'z'; // accessing freed memory
Same basic principle in each case - you're doing something with memory that isn't yours.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…