Regarding all indices problem

source.cpp: In function ‘int storeOccurence(int*, int, int, int, int*, int)’:
source.cpp:14:1: warning: control reaches end of non-void function [-Wreturn-type]
14 | }
| ^
what is the meaning of this error

@praveeng1234 this means return statement is missing in that function

int storeOccurence(int *a,int n,int key,int i,int *out,int j){ if(i==n){ return j; } if(a[i]==key){ out[j]=i; storeOccurence(a,n,key,i+1,out,j+1); } else{ storeOccurence(a,n,key,i+1,out,j); } }

int storeOccurence(int *a,int n,int key,int i,int *out,int j){ if(i==n){ return j; } if(a[i]==key){ out[j]=i; storeOccurence(a,n,key,i+1,out,j+1); } else{ storeOccurence(a,n,key,i+1,out,j); } } is code me return ho to rha hai phir kyo error aa rhi hai

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.