Program Help.

i am writing a program that has item.h item.cpp market.h market.cpp

under market.cpp i have to have a void market::print()
i have to print out all the items in item.cpp. items are in an array. how would i be able to do this. i know i have to do i for loop but dont know how to.


void market:: print()
{
cout<<Name<<Price<<endl;

for( ? )
}


need to take the info from void Item::print();
should print out like this

Name Price
Milk 2.00
bread 1.50
ham 3.00
stuff 1.00
Last edited on
how to store all this value?

1
2
#include<iomanip>  //include this
cout<<product_name<<setw(10)<<product_rate<<endl;// general formate 
Topic archived. No new replies allowed.