switch case works like this:
Code:
switch ( variable that can be used as an integer )
{
case #1: blah; blah; blah;break;
case #2: blah; blah; blah;break;
...
default: blah; blah; blah;break;
}
in your case:
Code:
do{
choice = mainMenu();
Stemplate();
switch ( choice )
{
case 1:
do{
loop = addItems(inventory,&arrayL);
}while (loop);
break;
case 2:
do{
loop = deleteItems(inventory,&arrayL);
}while (loop);
break;
case 3: viewItems(inventory,arrayL); break;
case 4: sortItems(inventory,arrayL); break;
case 5: searchItems(inventory,arrayL);
case 0: exitScreen(); break;
default: puts("Invalid input");
}
saveData(inventory,arrayL);
}while(choice != 0);