I am implementing a linked list and I get an error in line 28 "cannot convert ‘node<int>’ to ‘node<int>*’ in assignment". I am confused - next is of type node<T>* so why is it->next of type node<T>? Also, i get "‘class linkedlist<int>’ has no member named ‘print’ list.print();" and I don't know why. Can someone explain? Thanks!
I don't get your error when I compile but I do get an error re T shadowing a template parameter. I don't think you need the template<class T> in the method definitions.
The insert_me is a by value parameter.
It is essentially a local variable with automatic lifetime.
It is created and initialized on function call and destructed at the end of the function's body.
It is a big mistake to store address of soon-to-die object into pointer that outlives the function call.
Either you are not looking at the first error messages in the list or you have not posted the exact code that gives you those errors you mentioned (it's obviously not all the code).
C++ is one of those languages that just because some code at some point in time produces an expected output doesn't mean that the code is 'correct' or 'working' properly. This is especially true when using memory addresses...