about BaseList

Wang Shaofu wsffree at hotmail.com
Fri Sep 13 01:06:19 PDT 2002


Dear Prof.

There may be a mistake in the class of BaseList.
ent BaseList::remove_nth(int n)
    {
     ......
     for ( ; n < num_entries; n++ )	   //this is to remove the member 
following
	entry[n] = entry[n+1];        //the nth one forward.

     entry[n] = 0; 	// for debugging   ???Is this to make the nth one null?
     ......
     }
I thank that it should make the nth one null before removing the member 
following the nth one forward.And the code should be :
ent BaseList::remove_nth(int n)
    {
     ......
     entry[n] = 0; 	// for debugging   ???Is this to make the nth one null?
     
     for ( ; n < num_entries; n++ )	   //this is to remove the member 
following
	entry[n] = entry[n+1];        //the nth one forward.
     ......
    }
Or I get the wrong idea of your code?
Thanks very much,
Have a nice day.
Ciao
         Cloud



_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。http://www.hotmail.com/cn




More information about the Bro mailing list