i am trying to implement a linked list.
List has private variables *head, *tail, count.
I understand the logic in the data structure, but admittedly I am new to C++, so i feel like i may be using the constructor incorrectly.
*head and *tail are list node pointers. list nodes then have pointers to previous and next (doubly linked list).
here is what I tried:
List::List():head(), tail(), count(0) {
head->previous = NULL;
head->next = tail;
tail->previous = head;
tail->next = NULL;
}
my program compiles but crashes when it tries to make a new list with this constructor. any suggestions?