14 int main (int argc
, char const *argv
[])
16 Task
*task_head
= NULL
;
17 Task
*task1
= new Task(1, NULL
);
18 Task
*task2
= new Task(2, NULL
);
19 Task
*task3
= new Task(3, NULL
); // Orphaned.
20 Task
*task4
= new Task(4, NULL
);
21 Task
*task5
= new Task(5, NULL
);
35 printf("We have a total number of %d tasks\n", total
);
37 // This corresponds to an empty task list.
38 Task
*empty_task_head
= NULL
;
40 Task
*task_evil
= new Task(1, NULL
);
41 Task
*task_2
= new Task(2, NULL
);
42 Task
*task_3
= new Task(3, NULL
);
43 task_evil
->next
= task_2
;
44 task_2
->next
= task_3
;
45 task_3
->next
= task_evil
; // In order to cause inifinite loop. :-)
47 return 0; // Break at this line