代码
//指针可以当作数组来用
#include<stdio.h>
#include<stdlib.h>
int main()
{
int number;
int *a;
int i;
printf("input number:");
scanf("%d",&number);
a = (int*)malloc(number*sizeof(int));
for(i=0;i<number;i++)
{
scanf("%d",&a[i]);
}
printf("start reverse output:\n");
for(i=number-1;i>=0;i--)
{
printf("%d\n",a[i]);
}
free(a);//释放内存
return 0;
}