Actually I'm making a budget calculating app, where there is a class for the items I buy.
class Item
{
string name;
string date;
int amount;
float singlePrice;
float totalPrice;
// constructor
Public Item(string name, int amount, float price)
{
}
};
But I don't want to hard code every Item, I want to add items in the app and save it to file and calculate how much money I have left.
Boughts in there. Some are more suitable depending on how you want to access the data but you've got some options, (vector, unordered_map, ...). Other than the choice of data stucture there's another important choice you need to make: how do you persist the data? Database, file, ...?