nclude"stdio.h"
main()
{
int a[10] = { 1,2,3,4,5,6,7,8,9,10 }, t = 0, *p = NULL, *q = NULL;
printf("初始值:");
for (p = a; p < a + 10; p++) //p=a相当于p=&a[0];a+10表示数组最后一个数组变量元素a[10]。
printf("%3d", *p);
for (p=a,q=a+9; q>p; p++,q--)
{
t = *p; *p = *q; *q = t; //数据对换。
}
printf("\n");
printf("最后排序:");
for (p=a; p<a+10; p++)
{
printf("%3d", *p);
}
system("pause");
return(0);
}