Hello, Ive been working on this inventory for practice for quite some time now and this is the last thing i need to do ive been trying everything i know to get it to work. which is adjusting the supply for each item it works when i dont exit it the program it saves it in the file and everything but when i exit the program after adding the items and then i choose edit inventory it doesnt work it wont save it to the file or anything.
a bug in your control flow is causing your problems
you need to put your code into functions and call those functions (a monolithic block of code is not good programming form, as illustrated by your trouble debugging your code).
you will not (we will not, either) understand your control flow like this
rewrite your code into something like this and your bug will become clear:
void addInventory() {
// put your implementation here
}
void checkInventory() {
// put your implementation here
}
void editInventory() {
// put your implementation here
}
main()
{
// blah, blah, blah
switch( choice ) {
case 1: addInventory(); break;
case 2: checkInventory(); break;
case 3: editInventory(); break;
}
}