-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBackpack.cpp
More file actions
45 lines (33 loc) · 713 Bytes
/
Copy pathBackpack.cpp
File metadata and controls
45 lines (33 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*********************************************************************
** Program name: FinalProject
** Author: James Scanlon
** Date: March 19, 2019
** Description: Implementation of the Backpack class.
*********************************************************************/
#include "Backpack.hpp"
// constructor
Backpack::Backpack()
{
head = nullptr;
tail = nullptr;
}
// get functions
Items* Backpack::getHead()
{
return head;
}
Items* Backpack::getTail()
{
return tail;
}
// destructor
Backpack::~Backpack()
{
Items* temp = getHead();
while (temp != nullptr)
{
Items* deleted = temp;
temp = temp->getNext();
delete deleted;
}
}