What are segmentation faults? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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?

30th Apr 2018, 4:41 AM
Suraj Kolla
Suraj Kolla - avatar
1 Resposta
+ 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
30th Apr 2018, 5:28 AM
ā€ŽĀ ā€ā€ā€ŽAnonymous Guy