怎么编写一个通过输入n的值来确定的含n个整形元素的数组?通过手动输入n的值,来确定数组的大小
3条回答 默认 最新
threenewbee 2019-04-03 00:05关注有的编译器支持直接开数组
int n;
scanf("%d", &n);
int arr[n];有的不支持,那么只能动态分配
int n;
scanf("%d", &n);
int * arr = (int *)malloc(sizeof(int) * n);本回答被题主选为最佳回答 , 对您是否有帮助呢?评论 打赏 举报解决 2无用 2