I'm having some trouble getting my linked list to work, here is the prompt.
Write a function with three parameters. The first parameter is a head pointer for a linked list of items, and the next two parameters are items x and y. The function should write to the screen all items in the list that are between the first occurrence of x and the first occurrence of y. You may assume that the items can be compared for equality using ==.
Here is what I have so far, I want to know if I am on the right track.
int main()
{
// Creates Pointer
node *the_pointer;
the_pointer = new node;
list_head_insert(the_pointer, 0);
// Inserts values into the link list
for(int i = 0; i < 10; i++)
{
list_insert(the_pointer, i);
}
node::value_type x = 1;
node::value_type y = 6;
getItems(the_pointer, x, y);
system("pause");
return 0;
}