Book myBooks[ 20 ];
already automatically creates the 20 books for you by calling the default constructor.
You should have covered this very basic bit of information while you were being introduced to C++ and before you were given this assignment. This is why in my previous post I was highly suspicious of the sophistication of your class definitions which included const correctness, exception thrown annotations, and streaming overrides, but then you then go turn around and ask how to implement the most simple function of checking in or checking out a book. Now you ask about how arrays and constructors work. There is a big disconnect.
Is there a chance you are jumping into this data structures class, but you didn't take a prerequisite intro to programming class and that is the cause of the disconnect?
Or perhaps you learned Java or Python as your first language or intro to programming class, and are just now switching to C++? That would answer the arrays and constructors question you posed, but still wouldn't explain the const correctness and stream overrides. The exception annotations may have come from Java experience.

New Topic/Question
Reply



MultiQuote




|