指针问题,麻烦帮忙看下
#include <stdio.h>int diaohuan(int b[], int n);
void main()
{
int a[10] = {3,7,9,11,0,6,7,5,4,2};
diaohuan(a[10], 10);
}
int diaohuan(int b[], int n)
{
int *p, i;
p = b;
for(i=0; i < n; i++)
{
*(p+9-i) = b[i] ;
printf("%d ",*(p+i));
}
return 0;
}
把数组内数字反向排序,麻烦大神看下哪里出错了,结果不对