C语言进阶-动态内存分配
#include <stdio.h>
#include<stdlib.h>int main()
{int number;int *a;int i;printf("请输入数组的数量");scanf("%d",&number);//int a[number];a=(int*)malloc(number*sizeof(int));//开辟数组的大小for(i = 0;i<number;i++){scanf("%d",&a[i]);}for(i=number-1;i>=0;i--){printf("%d\n",a[i]);}free(a);//记得释放栈空间return 0;
}