I am having trouble thinking of a way to structure this program.
I have 10+ items in stock.
I want to prompt the user how many of each he should have.
I then want to subtract by however many the user wishes.
The information must be retained when restarting the program.
i know i am going to need to get into file handling.
However, is this were inheritance comes into play in classes. Having so many items, is it best to have each item in a derived class? I do not really know the direction to go with this. Should i just start coding? will it all make sense lol...
Classes are possible but you are still left with the problem of managing the stock levels. So possibility is structs. Look carefully at the attributes you want.
have a plan, it's better than doing the coding without one. :)
So i need to allocate memory for an array of the number of items correct?
I will ask the user for number of items and each item name for the first run of the program. I am still confused on where the array would come into play.
So storing the number in a text file is enough. I don't believe I need an array.
I will just store the name along with the integer and manipulate each every time I need to from there.