1 Answers
Create a class of item, and then implement this code.
const int size =3;
int main()
{
item *p = new item[size];
item *d = p;
int x,i;
float y;
for(i=0;i<size;i++)
{
cout<<“Input code and price for item”<<i+1;
cin>>x>>y;
p->getdata(x,y);
p++;
}
for(i=0;i<size;i++)
{
cout<<“Items”<<i=1;
d->show();
d++;
}
return 0;
}