1
0

Library.cpp 449 B

123456789101112131415161718192021
  1. #include <iostream>
  2. #include "Library.h"
  3. // there is no means of adding books to the library
  4. Library::Library(){ // constructor
  5. bookNum = 10; // how many places for books
  6. b = new Book[bookNum]; // book array
  7. }
  8. void Library::printTitles(){ // prints the book titles
  9. int i = 0;
  10. for(i = 0; i < bookNum; i++){
  11. std::cout << b[i].getTitle() << std::endl;
  12. }
  13. }
  14. int Library::getBookNum(){ // gets the number of places for books
  15. return bookNum;
  16. }