Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct book{
- double b_width;
- struct book* next;
- struct book* prev;
- };
- Class Shelf
- {
- book* pierwsza_ksiazka;
- double szerokosc;
- public:
- Shelf(double w);
- ~Shelf();
- }
- Shelf::Shelf(double w)
- {
- book* dummy = NULL;
- pierwsza_ksiazka = dummy;
- szerokosc = w;
- }
- Shelf::~Shelf()
- {
- if(pierwsza_ksiazka)
- {
- book* obecny=pierwsza_ksiazka;
- while(obecny && obecny->next)
- {
- book* temp=obecny;
- obecny=obecny->next;
- delete temp;
- }
- delete obecny;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement