Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void insertFirst(book_list* b1, book* b) {
- book* tmp = b1->first;
- int ifExist = 0;
- do{
- if(strcmp(tmp->title,b->title)==0) {
- tmp->copies += b->copies;
- ifExist=1;
- }
- }while(tmp!=b1->first);
- if(ifExist==0) {
- b->next = b1->first;
- b1->first = b;
- b1->last->next = b1->first;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement