7213709-C-Programming

Page 277

printf ("Overtype starting from which entry"); *ctr = getint(1,99); for (ptr=Data[i].datptr; (ptr != NULL) && (j++ != *ctr); ptr=ptr->succ) { p = ptr; } return (p); } /*************************************************************/ struct list *install (ptr,t,i)

/* install item at thispos */

struct list *ptr; double t; int i; { struct list *thispos, *newstruct(); if ((thispos = newstruct()) == NULL) { warning(); printf ("DEBUG **: Free memory pool is empty"); exit(0); } if (!Data[i].datathere) { Data[i].datptr = thispos; Data[i].datathere = TRUE; } else { ptr->succ = thispos; } thispos->value = t; thispos->succ = NULL; return (thispos); } /************************************************************/ struct list *deletetoend (ptr) struct list *ptr; { if (ptr != NULL) { deletetoend (ptr->succ); releasestruct (ptr); } return (NULL);

/* RECURSIVE WELL - returns NULL for easy deletion of call ptr */


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.