我正在编写一个程序,该程序使用malloc来创建全局数组。我尝试了一下(当然是在main()之外): int *arr=malloc(5*sizeof(int)); 在GCC编译器中,闪现了以下错误: main.c:4:10: error: initializerelement is not constant ^ 我在Dev-C++上尝试过,但没有这样的错误中断编译
do something with the array and store it in the newArray}我的老师告诉我,大多数编译器的工作方式不同在int newArraysize = doSomething (数组,& size )行中,我期望在doSomething中更改size变量,然后再使用它初始化newArray。一旦它返回,我想将这个地址存储到我的新数组中,在这个数组中,<em