Originally Posted by
ssharish2005
Well you will have show us your attempt on this, its clearly not a rocket science. Here is an hint
Code:
while( *pSize < MaxSize )
{
if( inventory[*pSize].onHand <= 4 )
print all the invent information
(*pSize)++;
}
ssharish
Perfect Harish that's exactly what I was looking for. I think it was the early hour and my brain wheels were not turning yet. Thank you so much.
Code:
void inventoryReport(PRODUCT inventory[], int *pSize){
int i = 0;
printf(" Inventory Report \n");
printf(" **************** \n");
printf("Name Product Number On Hand Wholesale Price Retail Price \n");
printf("**** ************** ******* *************** ************ \n");
for(i = 0; i < *pSize; i++ ){
printf("%10s%10i%10i%10.2lf%10.2lf\n", inventory[i].name, inventory[i].number,
inventory[i].onHand, inventory[i].wholesale, inventory[i].retail);
}
}
void lowInventoryReport(PRODUCT inventory[], int *pSize) {
}
main (){
int effectiveSize = 0;
PRODUCT hammer = {"Hammer", 1234, 5.50, 8.99, 4};
PRODUCT inventory[500];
fillInProducts(inventory, &effectiveSize);
inventoryReport(inventory, &effectiveSize);
system("Pause");
}