Pardon me!! I am new here. I am unable to use addNode function. When i declare Node* it doesnt compile.
I am trying to implement a linked list in c++ without
using structures and only use pure classes.I am rusty here. Any help would be great.
head->addNode() and head.addNode() doesnt work.
Create the object in the heap first. You just declared a variable stating "I will hold address of Node object in a variable head". But, where does that object? When there is no object head-> will not work. Head.addNode() also wont work as the object is not in stack.
Node* head = new Node();