Hi Valmont I'm sorry for my last post. what i meant was I need this for the program:
a)to add an item to an inventory which is in a row cloumn format e.g [10][2]
b)display all contents
c)display total of everything
d)find specific item at row column
e)store name of supervisor
the problem is for I also need to provide details on the items like description and cost. But I wrote the initial program, then i realise i need to update and display the data stored in each column that contains the no. of items and a pointer to the item's details. Here's a preview on what I want to do but I am not good with objects, pointers & data structures. My previous version of my program is sadly now void
Code:
class item
{
}
item item [2];
class shelf
{
public
int quatity
item*item
}
class warehouse
{
shelf shelf [10][2];
Add item
&item[1]
item=&item[0]
shelf[r][s].quantity
void Item::Update(void)
{
char temp[200];
cout << "Enter name: ";
cin.getline(name, 30);
cout << "Enter description: ";
cin.getline(temp, 200);
int size = strlen(temp);
description = new char [size + 1];
strcpy(description, temp);
cout << "Enter cost: $";
cin >> cost;
cin.ignore();
}
void Item::Display(void)
{
cout << "Name: " << name << endl;
cout << "Description: " << description << endl;
cout << "Cost: $" << cost << endl;
system("pause");
system("cls");
}