0 curr head while curr next is this the end curr

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ->next = 0; if (Head != 0) { curr = Head; while (curr->next) // is this the end? curr = curr->next; curr curr->next = tmp; >next tmp } else Head = tmp; Head tmp } Applied Programming bool LinkedList::Remove(char name, int& psize) name, int psize { CustPtr tmp; // // if (Head == 0) return false; strcpy(name,Head->name); psize = Head->partysize; make a copy of the pointer to current head make tmp = Head; Head = Head->next; // change the head Head Head delete tmp; // delete old head's memory delete tmp return true; } Applied Programming So, where does the class get access to Head? So, Head It's in the private section of the class. It's private In summary, the class has the following syntax In (for now) (for This declaration describes the interface to the This user – and to the compiler. A user has access to those parts in the public user public section, but not those in the private part. section, private The (private) data is protected. class classname class classname { public: class classname class classname { public:...
View Full Document

Ask a homework question - tutors are online