Rain Water harvesting Problem statement

@Vikaspal
replace int right[]={0} with int right[n]={0};

thanks @aman212yadav for resolving the issues. one thing more when we don’t mention the size of array it will taken automatically, what will happen in our case?

@Vikaspal
yeah you are correct it will be taken automatically and that size will be number of entries in ur curly braces for example
if i write int arr[] ={1,2,3} ;
then array size will be 3
in ur case i,e int right[]={0};
there is one single entry in curly braces that why size of right array was 1

1 Like

ohh Great! really thanks @aman212yadav great disccussion

1 Like

@Vikaspal
pls dont forget to mark it as resolved

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.