| 123456789101112131415161718192021 |
- #include <iostream>
- #include "Library.h"
- // there is no means of adding books to the library
- Library::Library(){ // constructor
- bookNum = 10; // how many places for books
- b = new Book[bookNum]; // book array
- }
- void Library::printTitles(){ // prints the book titles
- int i = 0;
- for(i = 0; i < bookNum; i++){
- std::cout << b[i].getTitle() << std::endl;
- }
- }
- int Library::getBookNum(){ // gets the number of places for books
- return bookNum;
- }
|