这代码为什么错了啊
#include<iostream>using namespace std;
void APP(int *pa,int n);
int main()
{
int *ary=NULL,*t;
int i,n;
cout<<"n=";
cin>>n;
APP(ary,n);
for(t=ary;t<ary+n;t++)
cout<<*t<<" ";
cout<<endl;
for(i=0;i<n;i++) ary[i]=10+i;
for(i=0;i<n;i++) cout<<ary[i]<<" ";
cout<<endl;
delete []ary;
ary=NULL;
}
void APP(int *pa,int len)
{
pa=new int[len];
if(pa==NULL)
{
cout<<"allocation faiure\n";
return;
}
for(int i=0;i<len;i++) pa[i]=0;
}