node &getNode(int index) { //NOT TESTED
if (index <= getLength() || index >= 1){
temp = new node;
temp = head;
for (int i=index-1; i>0; i--){
temp = temp->next;
}
return &temp;
}
}
Hi everyone,
I receive this error msg:
invalid initialization of non-const reference of type 'node&' from a temporary of type 'node**'
I cannot change the return type of the method so how can i return that reference.
Thanks