I'm working on a food bank software for a c prog. class.
the program has a list of five choices when in runs.
1-make a donation
2-make a request
3-fill a request
4-print status report
when the user inputs 1 for make a donation, they are asked to input the inventory type and amount. this all works fine. i added a test at the end of the donation section of the code that prints the inv. type and amount and this is working fine.
when i print the status report after making 2 donations, it only prints the last donation. as another check i had it print its position in the array. and it says position (0). im lost. im guessing the error is somewhere in the donations section but i cant figure it out. if i change anything, i get different errors.
because this is an assignment i am only going to post a section of the code. if you think you can help i can PM or email you the rest of it. or maybe you'll be able to see whats wrong without the rest of the code.
thanks in advance for the help.
just to explain the program a little more.
this is my first programming course so that is why my code is so elementary. (but im trying!)
if the user inputs a second donation of the same inventory type it should just add the amount of the first donation and the second donation without making another entry in the inventory type. just in case you are wondering why there is a strcmp in there.