C++动态创建数组
#include "TestMain.h"
void ShowDatas(int len);
int main()
{
cout<<"请输入创建数组的长度"<<endl;
int length;
cin>>length;
ShowDatas(length);
int end;
cin>>end;
return 0;
}
void ShowDatas(int len)
{
int *pArray=NULL;
pArray=new int[len];
for(int i=0;i<len;i++)
pArray[i]=i;
for(int j=0;j<len;j++)
cout<<pArray[j]<<endl;
int end;
delete []pArray;
}