previous next Up Title Contents Index

pääohjelma
    /* PÄÄOHJELMA */
    void main (void)
    {
        struct jono_t jono;
        char valinta;
        init(&jono);
        clrscr();
        do{
            window(1,1,80,6); /* Turbo C: conio.h */
            textbackground(BLUE); /* Turbo C: conio.h */
            textcolor(YELLOW); /* Turbo C: conio.h */
            clrscr();
            cprintf("\r\n1 - Lisää jonoon");
            cprintf("\r\n2 - Poista jonosta");
            cprintf("\r\n3 - Lopetus");
            cprintf("\r\nAnna valintasi:");
            valinta = getche();
            switch (valinta)
            {
                case '1': lisaa(&jono);
                break;
                case '2': poista(&jono);
                break;
                case '3': ;
            }
            if (valinta != '3')
            {
                window(1,8,80,25);
                textbackground(YELLOW);
                textcolor(BLUE);
                clrscr();
                show(&jono);
            }
        }while (valinta!='3');
    } 

previous next Up Title Contents Index