int* exchange(int b[])
{
int temp = 0,i = 0,p;
while(i < N / 2)
{
p = N - 1 - i;
temp = (b+i);
(b+i) = (b+p);
(b+p) = temp;
i++;//最后一次的时候为什么i直接从5变成了10??
}
return b;
}
void main()
{
int i,a[N] = {0,1,2,3,4,5,6,7,8,9},*b;
printf("交换前的数组:\n\t");
for (i = 0;i < N;i++)
printf("%3d",a[i]);
printf("\n");
b = exchange(a);
printf("交换后的数组:\n\t");
for (i = 0;i < N;i++);
printf("%3d",*(b+i));
printf("\n");
}
for
之后多了一个分号。