can you tell me why this doesn't work.
int function(int);
int main()
{
int g[20],N;
printf("Type N");
scanf("%d",&N);
g[20]=function(N);
printf("s[0] is %d\n",g[0]);
printf("s[1] is %d\n",g[1]);
printf("s[2] is %d\n",g[2]);
}
int function(int N){
int s[20];
s[0]=1;
s[1]=3;
s[2]=5;
return s[20];
}
I just want that my function return this numbers 1,3,5 but it returns some weird numbers, i thinks it's adresses or something. PS. I just began to learn C.