Rain water harvesting

My code shows segmentation fault.Here is the link to it :


Kindly point out errors in this

declaring large arrays inside main function leads to seg fault.
try global