Guest User

Untitled

a guest
Oct 18th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. int main()
  2. {
  3. LinkedList myList;
  4. ifstream myFile("booklist.txt");
  5.  
  6. string title;
  7. string author;
  8. Date published;
  9. string publisher;
  10. float price;
  11. string isbn;
  12. unsigned int pages;
  13. unsigned int copies;
  14.  
  15. while( myFile ){
  16. getline(myFile,title);
  17. getline(myFile, author);
  18. myFile >> published._day >> published._month >> published._year;
  19. myFile >> publisher;
  20. myFile >> price;
  21. myFile >> isbn;
  22. myFile >> pages;
  23. myFile >> copies;
  24.  
  25. myList.insert_rear( new Book(title, author, published, publisher,
  26. price, isbn, pages, copies));
  27. }
  28.  
  29. myList.print_list();
  30.  
  31. return 0;
  32. }
Add Comment
Please, Sign In to add comment