hi, emm I don't understand but, my program on the moment to run, say : segmentation fault, and I don't know what to do, please help
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#include <iostream>
usingnamespace std;
int mistery (int avalues[], int ienigma, int in, int IN){
if (in == IN ) {
return ienigma;}
else {
if (avalues[in] > ienigma){
ienigma=avalues[in];}
mistery (avalues,ienigma, in+1, IN);}
}
1 2 3 4 5 6 7 8 9 10 11 12 13
int main () {
int n;
int avalues [n];
cin>> n;
for (int i=0 ;i<n; i++) {
avalues [i]= i+1; }
cout<< mistery (avalues, -2, 0, n);
return 0;