previous next Up Title Contents Index

Alkion poistaminen jonosta

    struct jono_alkio_t *get (struct jono_t *jono)
    {
        /* GET POISTAA JONOSTA ALKION */
        struct jono_alkio_t *pois;
        if (empty(jono))
        {
            cprintf ("\r\n\aERROR: ");
            cprintf Poistoyritys tyhjästä jonosta");
            exit (1);
        }
        else
        {
            pois = jono->eka;
            if (pois==jono->vika)
            {
                jono->eka=jono->vika=NULL;
            }
            else
            {
                jono->eka = jono->eka->seuraava;
                pois->seuraava=NULL;
            }
            return pois;
        }
    } 

previous next Up Title Contents Index