Piyush And Magical Park

How to correct the segmentation fault??

hello @mmk32001
segmentation fault occurs either due to invalid memory access or due too much memory allocation in program.
invalid memroy access -> either u are trying access negative index of an array or index is greater than equal to size of ur array.

too much memory allocation -> u might be declaring a big size array in ur program probably of order of 10^8 or greater.

if u have issue with logic then u check this video by prateek bhaiya.
Piyush and magical park

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.