/in/foo.cc: In function 'int Joseph(int, int, int*)':
/in/foo.cc:21:33: error: invalid conversion from 'int' to 'int*' [-fpermissive]
return ((Joseph(n-1, m, a[i+1])+ a[i+1])%n);
~~~~~^
/in/foo.cc:4:5: note: initializing argument 3 of 'int Joseph(int, int, int*)'
int Joseph(int n, int m, int *a)
^~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:35:21: error: invalid conversion from 'int' to 'int*' [-fpermissive]
cout<<Joseph(N, m, *a);
^~
/in/foo.cc:4:5: note: initializing argument 3 of 'int Joseph(int, int, int*)'
int Joseph(int n, int m, int *a)
^~~~~~
/in/foo.cc: In function 'int Joseph(int, int, int*)':
/in/foo.cc:24:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^