采用动态分配即可实现,例如: #include using namespace std; void main() { int* pArray = NULL; //动态数组 int N; // 动态确定的数组个数 cout << "Please input the number of element in t...
int *p=NULL,n;printf("Please input the num of elements:\n");scanf("%d",&n);p=(int *)malloc(n*sizeof(int));if(!p)printf("Memory is not accessed!\n")else{/*...