I've a little doubt in arrays,
i'm trying to make a program that change, the 1st element of an array ( v[0] ) for the last one ( v[5] for example).
i call the funcion change:
Code:
void change(int v[], int x){
int i , t , x;
for(i=0;i<=n-1;i++){
x=v[0];
t=v[n-1];
v[0]=t;
v[n-1]=x;
}
for(i=0;i<=n-1;i++){
printf("%d\n", v[i]);
}
}
and i use these main:
Code:
int main(){
int a[SIZE]={8,5,6,9,1,3}, m=6, i;
for(i=0;i<=m-1;i++){
printf("%d\n"a[i]);
}
printf("\n\n");
change(a,m);
}
Can anybode tell me what's wrong in the function??
thank u, johnny!