Well, this code prints "Invalid position" then exit (it's a very bad solution: after exit() automatic class variables destructors are not called). You don't use modified append function. Moreover, passed by reference data argument can't raise new problems at all...
I have no time to debug your code from the beginning. Please, make a proper test plan, prepare test cases then ask help with the serious problems brief and clear description.
It's so simply to destruct your list via improper calls of these low-level functions. May this package debugging troubles help you to understand that all these low level operations must be incapsulated in the well-designed class

...
Last edited by ArkM; Nov 22nd, 2008 at 2:50 pm.