[Solved] what is wrong with this c++ linked list code?


and the visual studio just gived me like over 30 Errors though the code seems perfectly fine to me

It’s not fine, it’s full of errors.

Listen to your compiler. Go to the lines it tells you have errors. Fix them.

For example:

     head = head > next;

That’s clearly wrong. Fix it.

And this isn’t valid C++:

friend Linkedlist ;

it should be:

template<class T> friend class LinkedList;

but you should declare LinkedList first, before you say it’s a friend.

2

solved what is wrong with this c++ linked list code?