Segmentation faults: what they are and general tips for how to avoid them?
Most sources I come across define segmentation faults as something along the lines of this: that they occur when a program references an undefined area of virtual memory

But since I haven't yet taken a class on Operating Systems, I usually have no idea what this means that it's an "undefined area" of virtual memory...

Also, a lot of my C programs tend to run into the segmentation fault, and unfortunately I have no idea how to fix them. Are there any good tips for how to avoid these faults, and what to do when one has been encountered when all the logic of the program seems alright?
Segmentation faults: what they are and general tips for how to avoid them?
===

Most sources I come across define segmentation faults as something along the lines of this: that they occur when a program references an undefined area of virtual memory

But since I haven't yet taken a class on Operating Systems, I usually have no idea what this means that it's an "undefined area" of virtual memory...

Also, a lot of my C programs tend to run into the segmentation fault, and unfortunately I have no idea how to fix them. Are there any good tips for how to avoid these faults, and what to do when one has been encountered when all the logic of the program seems alright?