出错,求解决
#include<iostream>struct CandyBar
{
char brand[20];
double weight;
int kaluri;
};
int main()
{
using namespace std;
CandyBar ab[3]={{"Mocha Munch",2.3,350},{"aaa",3.2,400},{"cde",5.2,200}};
CandyBar *abc =new CandyBar[3];
abc=ab;
int i;
for(i=0;i<3;i++)
{
cout <<"abc"<<i+1<<endl;
cout <<" brand :"<<(abc+i)->brand;
cout <<" weight :"<<(abc+i)->weight;
cout <<" kaluri :"<<(abc+i)->kaluri<<".\n";
}
delete abc;
return 0;
}