void Shop::AddBook(const char* pTitle, unsigned int unitPricePence, unsigned int noOfPages) { std::shared_ptr<Item> newbook (new Book(std::string(pTitle), unitPricePence, noOfPages)); list.push_back(newbook); }
/* * THe method pointbook() returns the pointer to the book searched for * passing in the listhandle, bookname, and the bookid */ void pointbook(ListHndl L, char* bookname, ListHndl bookid) { (void*) bookname; NodePtr book = newbook(bookname, bookid); if(L->last == NULL) { L->first = book; L->last = book; } else if(L->last != NULL) { L->last->next = book; book->prev = L->last; L->last = book; } L->size = L->size + 1; }