Your function's signature expects a ItemType
, which is int
in your case:
int Push(ItemType newitem);
But you are trying to pass a Node<ItemType>
, hence you get an error.
Your Push
function is already creating a a node internally, so you'd pass the integer directly into it:
Linked_List <int> test;
int test2 = 4;
test.Push(test2);
I need to point out that your code has several other problems besides that, though - for starters, this snippet:
Node <ItemType> *nnode; //create new node to store new item
Does not create a Node - it just declares a pointer.
I'd strongly advise you to read up on C++'s basics.