I need to define a structure (or class) in c++ which has a fixed number of data/function members. Though the number of instances made from this class needs to increase or decrease (and I do not know how many instances I need, that's determined on the fly). An example is a class "book" with data members: "cost", "author", etc. but the number of books in the library can increase/decrease as people borrow/bring back books. So I cannot use something like:
book *pointer = new book[3]
As I am not sure if I will have 3 books.
Please guide me on what kind of strategy I should take.