DEV Community

Discussion on: I'm an Expert in Memory Management & Segfaults, Ask Me Anything!

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

Dereferencing a null pointer is usually a pretty reliable way of causing a segmentation fault. Of course, in so doing, you're killing the program. You could just as easily use assertions or system calls to deliberately crash in a more controlled manner.