Hello! The problem is that I cannot remove the last item from the list.
#include <iostream> using namespace std; class catalog { struct books { char name[20]; char autor[10]; }; struct elem { books data; elem * pnext; }; public: void add(); void show(); void find_by_autor(char * autor); void dell(); elem * plist = NULL, * pfirst; }; void catalog::add() { elem * tmp = new elem; cout << "input name of book "; cin >> tmp - > data.name; cout << "input autor of book "; cin >> tmp - > data.autor; if (!plist) { tmp - > pnext = NULL; plist = tmp; pfirst = plist; } else { plist - > pnext = tmp; pfirst = plist; } } } void catalog::dell() { }