nstring &
list::operator ++ () { //prefix
n if (!ptr || !(ptr->next)) {
n //consider what other alternatives there
are
n string * temp = new string; //just in
case
n return *temp;
n }
n ptr = ptr->next;
n return ptr->obj;
n}
nstring operator ++
(int){ //postfix
n string temp;
n if (!ptr) {
n temp = “\0”; //what does this do?
n return temp; //and this?
n }
n temp = ptr->obj; //and this?
n ptr = ptr->next; //and this?
n return temp; //and this?
n}
n