C++ excercise with linked lists not working properly, code getting complicated

Printable View