C语言使用malloc函数创建动态数组,C++使用new关键字创建动态数组。int *a=(int*)malloc(sizeof(int)*n); //创建大小为n的int数组aint *a=new int[n]; //创建大小为n的int数组a