Expected ‘;’ before ‘currentNode’

The problem is here:

node node;

After that, the name node refers to the local variable, not the type. Since it’s a class type, you could refer to it as class node or struct node thereafter; but a better option might be to use a different name for the variable.

Leave a Comment