++




- 9


_at_end = prev;

return elem_cnt;

}

}

else {

prev = plist;

plist = plist->next();

}

return elem_cnt;

}

: , , , .

#include <iostream>

#include "ilist.h"

int main()

{

ilist mylist;

cout << "\n-----------------------------------------------\n"

<< " #1: - \n"

<< "-----------------------------------------------\n";

mylist.insert_front( 1 ); mylist.insert_front( 1 );

mylist.insert_front( 1 );

my1ist.insert_front( 2 ); mylist.insert_front( 3 );

my1ist.insert_front( 4 );

mylist.display();

int elem_cnt = mylist.remove( 1 );

cout << "\n" << " " << elem_cnt

<< " () 1\n";

mylist.display();

mylist.remove_all();

cout << "\n-----------------------------------------------\n"

<< " #2: - \n"

<< "-----------------------------------------------\n";

mylist.insert_front( 1 ); mylist.insert_front( 1 );

mylist.insert_front( 1 );

mylist.display();

elem_cnt = mylist.remove( 1 );

cout << "\n" << " " << elem_cnt

<< " () 1\n";

mylist.display();

mylist.remove_all () ;

cout << "\n-----------------------------------------------\n"

<< " #3: - \n"

<< "-----------------------------------------------\n";