What am I doing wrong with this linked list? Cause I'm getting an error of my type and an error that delname is not declared.
void erase()
{
struct Customer *ptrthis;
struct Customer *ptrlast;
char delname[81];
if (ptrfirst == NULL)
{ printf("\nEmpty list.\n"); return; }
printf("\nEnter name to be deleted: ");
gets(delname);
ptrthis = ptrfirst;
do
{
if( strcmp(ptrthis->Cname, delname)==0 )
{
if(ptrthis==ptrfirst)
ptrfirst = ptrthis->ptrnext;
else
ptrlast->ptrnext = ptrthis->ptrnext;
free(ptrthis);
return;
}
ptrlast = ptrthis;
ptrthis = ptrthis->ptrnext;
}
while(ptrthis != NULL);
printf("No such name on list\n");
}