Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.43 KB | None | 0 0
  1.  
  2. #include "UsersOperation.hpp"
  3.  
  4. using namespace std;
  5.  
  6.  
  7. void OutputAllBooksToConsole(
  8.     infoAboutBook * library,
  9.     const int & maxLibrarySize)
  10. {
  11.     for (int bookIndex = 0; bookIndex < maxLibrarySize; bookIndex++)
  12.     {
  13.             const int bookNumber = bookIndex + 1;
  14.             if (library[bookIndex].title != "")
  15.             cout <<
  16.                 bookNumber << ")" << endl << "Íàçâàíèå:" << library[bookIndex].title << endl << "Àâòîð:" << library[bookIndex].author << endl << "Òåêñò:" << library[bookIndex].text << endl;
  17.        
  18.     }
  19.  
  20.  
  21. }
  22.  
  23. void ExitFromProgram(
  24.     infoAboutBook * library,
  25.     int maxLibrarySize)
  26. {
  27.     for (int bookIndex = 0; bookIndex <= maxLibrarySize; bookIndex++)
  28.     {
  29.       library[bookIndex].author = "";
  30.       library[bookIndex].title = "";
  31.       library[bookIndex].text = "";
  32.  
  33.     }
  34.  
  35.     delete[] library;
  36. }
  37.  
  38. int AddNewBook(
  39.     infoAboutBook * library,
  40.     int & currBookOffset)
  41. {
  42.     cout << "Ââåäèòå íàçâàíèå" << endl;
  43.     cin >> library[currBookOffset].title;
  44.     cout << "Ââåäèòå àâòîðà" << endl;
  45.     cin >> library[currBookOffset].author;
  46.     cout << "Ââåäèòå òåêñò" << endl;
  47.     cin >> library[currBookOffset].text;
  48.     currBookOffset++;
  49.     return currBookOffset;
  50. }
  51.  
  52. void DeleteBook(
  53.     infoAboutBook * library)
  54. {
  55.     wcout << L"Ââåäèòå íîìåð êíèãè, êîòîðîãî âû ñîáèðàåòåñü óäàëèòü:" << endl;
  56.     int deleteBookNumber;
  57.     cin >> deleteBookNumber;
  58.  
  59.     // Îñâîáîæäàåì ïàìÿòü.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement