my code is working fine on my offline compiler but why i am getting an issue on this compiler
Segmentation Fault
A segmentation fault is issued when you’re trying to access a memory address that does not belong to you.
the three most common causes of segfaults are-
- accessing an index that is out of bounds of an array.
- forgetting the “&” in the scanf.
- trying to access an address that is freed.
Check for the above 3 possible mistakes.
Some compilers have complex memory management scheme which takes care of the segmentation fault and therefore they might not throw any potential segfault errors.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.