I aint able to determine the size of the returned array !,, what shud ido?

#include<bits/stdc++.h>
using namespace std;

int* All_indices(inta,int i,int n,int m,int out,int j){
if(n==1){
return out;
}
if(a[i]==m){
out[j]=i;
All_indices(a,i+1,n-1,m,out,j+1);
}
else{
All_indices(a,i+1,n-1,m,out,j);
}
return out;
}

int main(){
int n;
cin>>n;
int a[n]={0};
for(int i=0;i<n;i++){
cin>>a[i];
}
int m;
cin>>m;
int out[n];
int *res=All_indices(a,0,n,m,out,0);
for(int i=0;------;i++){
cout<<res[i]<<endl;
}

return 0;

}

Pls reply in chat …