since the csum[ ] was initialize with size=1000
int csum[1000]= {0} ;
what if my array has more than 1000 elements.
So, how to initialize csum[ ] then?
Initializing array size >1000 for csum[ ]
In the video, for calculation of sum i.e. sum=csum[j]-csum[i-1]; for i=0 and j=i (j=0) what will be csum[i-1] ? (csum[-1]) It should be segmentation fault right?
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.
hi @anujeet.s it should be a fault but maybe it has taken garbage value this time, u r right and for array size u can change the size if more elements are there