+ 2
What are segmentation faults?
Mnay times I have experienced a problem while executing my c++ codes. The compiler never showed an error during compilation, but half way through the execution, a message "Segementation fault(core dumped)" appeared on the screen. What actually are these? Why do they occur? What can I do to avoid them?
2 Respuestas
+ 1
segmentation fault occurs when try to access memory you don't have access to
eg: int a[49];
a[50] = 12; //this causes segmentation fault