progs/C2b.c
changeset 472 d1da4bd4d7e9
equal deleted inserted replaced
471:97ab057cbd2e 472:d1da4bd4d7e9
       
     1 void welcome() { printf("Welcome!\n"); exit(0); }
       
     2 void goodbye() { printf("Wrong identity, exiting!\n"); exit(1); }
       
     3 
       
     4 int main(){
       
     5   char name[8];
       
     6   char pw[8]; 
       
     7 
       
     8   printf("login: "); 
       
     9   get_line(name);
       
    10   printf("password: "); 
       
    11   get_line(pw);
       
    12 
       
    13   if(match(name, pw) == 0)
       
    14     welcome();
       
    15   else
       
    16     goodbye();
       
    17 }