Here in this code is the function ElAdd, which adds elements to the list. Help me on the basis of this code to write the ElDel function - to remove items from the list.
#include <iostream> using namespace std; struct element { string data; element *adress; }; class List { private: element * StartAdress, *FinishAdress; public: List() { StartAdress = NULL; FinishAdress = NULL; } void ElAdd(string a) { element *e; e = new element; e->data = a; e->adress = StartAdress; StartAdress = e; } void print() { if (StartAdress == NULL) { cout << "List is Emptyn"; return; } element *e; for (e = StartAdress; e != NULL; e = e->adress) cout << e->data << " " << endl; } }; int main() { string x, y, z, a, b; getline(cin, x); getline(cin, y); getline(cin, z); getline(cin, a); getline(cin, b); cout << "--------------------------" << endl; List L; L.ElAdd(x); L.ElAdd(y); L.ElAdd(z); L.ElAdd(a); L.ElAdd(b); L.print(); system("PAUSE"); return EXIT_SUCCESS; }