Code:
#include <iostream>
#include <iomanip>
const long MAX = 100;
struct stMenuItem
{
int index;
char desc[MAX];
};
struct stMenu
{
char caption[MAX];
stMenuItem menu[MAX];
int elements;
};
int show(struct stMenu[MAX]);
using namespace std;
int main ()
{
int i = 1;
stMenuItem main[MAX] = {
{1,"Load Database"},
{2,"Manage Products"},
{3,"Manage Vendors"},
{4,"View Purchase Orders"},
{5,"Save Database"},
{6,"Exit Application"}};
stMenuItem prod[MAX] = {
{1,"Find a Product"},
{2,"Add New Product"},
{3,"Delete A Product"},
{4,"Update Product Preferred Vendor"},
{5,"Update Product Stock Amount"},
{6,"Load Database"},
{7,"Manage Products"}};
stMenuItem vend[MAX] = {
{1,"View All Vendors"},
{2,"Find Vendor"},
{3,"Add New Vendor"},
{4,"Delete a Vendor"},
{5,"Update Vendor Data"},
{6,"Return To Main Menu"}};
stMenu menu[MAX] = {
{"Inventory Control Executive",main[MAX],6},
{"Manage Products",prod[MAX],7},
{"Manage Vendors",vend[MAX],6}};
show(menu);
return 0;
}
int show(struct menu[MAX])
{
int i=0;
cout << menu[i].caption;
return 1;
}
Also I am aware this will just flash up and disapear in the event that it does work, but there is more to the program.. I just wanna figure out this.