struct List *List_getrest(struct List *pOrig, struct List *pRest);
The caller must allocate for and pass the parameter pRest
as
follows:
struct List *theRest; // the list to process is given as pList theRest = List_new(); List_getrest(pList, theRest); // do something with ``theRest'' free(theRest); // remember to deallocate the list
The implementation is as follows:
struct List *List_getrest(struct List *pOrig, struct List *pRest) { *((struct _List *)pRest) = *((struct _List *)pOrig); ((struct _List *)pRest)->index++; return pRest; }