void eliminar(char *ptrvalor)
{
hospital *ptraux=list,*ptrant=NULL;
if(ptraux==NULL)
cout<<"NO HAY ELEMENTOS EN LA LISTA\n";
else
if(ptrvalor<list->nombre_paciente)
cout<<"NO EXISTE EL ELEMENTO\n";
else
{
while(ptraux->nombre_paciente<ptrvalor)
{
ptrant=ptraux;
ptraux=ptraux->sig;
if(ptraux==NULL)break;
}
if((ptraux==NULL)||(ptraux->nombre_paciente!=ptrvalor))
cout<<"NO EXISTE EL ELEMENTO\n";
}
else
{
if(ptrant!=NULL)
{
ptrant->sig=ptraux->sig;
delete ptraux;
}
}
else
{
delete ptraux;
list==NULL;
}
}