new分配动态结构数组空间怎么不成
#include<iostream>using namespace std;
struct pisa
{
char name[10];
int zj;
int zl;
};
int main()
{
// using namespace std;
pisa p;
p=new pisa[2];
for(int i=0;i<2;i++)
{
cout<<"请输入比萨的no. "<<i<<"公司名称"<<endl;
cin.get(p[i]->name,10);
cout<<"请输入比萨"<<i<<"的直径"<<endl;
cin>>p[i]->zj;
cout<<"请输入比萨"<<i<<"的重量"<<endl;
cin>>p[i]->zl;
}
for(int i=0;i<2;i++)
{
cout<<"公司"<<i<<"名称:"<<p[i]->name<<","<<i<<"直径:"<<p[i]->zj<<","<<i<<"重量:"<<p[i]->zl<<endl;
}
delete []p;
return 0;
}