コード例 #1
0
ファイル: Shop.cpp プロジェクト: giuliojiang/Testing
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);
}
コード例 #2
0
ファイル: List.c プロジェクト: asilva3/CMPS101
/*
 * 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;
}