inventory system display

a little help please, how will i be able to make a table of
display for all user inputs at the end of the program a table something like this
BRAND NAME PRICE STOCK SOLD

thanks guys


#include<stdio.h>
#include<string>
#include<cctype>
#include<cstring>
#include<iostream>

using namespace std;


struct inventoryRec
{
char prodtype[100];
char brand[100];
float price;
int stock;
int sold;

};

void main()
{
inventoryRec product[10];
int inventory,invctr=0,brandctr,prodctr,num=1,num2,prodnum=0,genctr;
int left;


cout<<"************* INVENTORY SYSTEM C++.2 *************"<<endl;
cout<<"Enter Number of Generic Products for Inventory:";
cin>>inventory;
cout<<endl<<"Enter "<<inventory<<" Generic Products:"<<endl;

while(invctr<inventory)
{
genctr=1;

cout<<endl;
cout<<"GENERIC PRODUCT ["<<num<<"]: ";
cin>>product[genctr].prodtype;
cout<<"How many "<<product[genctr].prodtype<<" ?: ";
cin>>prodnum;

num2=1;
prodctr=0;

cout<<endl;

while(prodctr<prodnum)

{
brandctr=1;

cout<<"Brand Name for "<<product[brandctr].prodtype<<" ["<<num2<<"]: ";
cin>>product[brandctr].brand;
cout<<"Price: Php ";
cin>>product[brandctr].price;
cout<<"Stock: ";
cin>>product[brandctr].stock;
cout<<"Sold: ";
cin>>product[brandctr].sold;
cout<<endl;
brandctr++;
num2++;
prodctr++;

}

genctr++;
num++;
invctr++;
}
}

Topic archived. No new replies allowed.