progs/C2b.c
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Tue, 11 Oct 2016 15:14:59 +0100 (2016-10-11)
changeset 477 b2c5a721f360
parent 472 d1da4bd4d7e9
permissions -rw-r--r--
updated
void welcome() { printf("Welcome!\n"); exit(0); }
void goodbye() { printf("Wrong identity, exiting!\n"); exit(1); }

int main(){
  char name[8];
  char pw[8]; 

  printf("login: "); 
  get_line(name);
  printf("password: "); 
  get_line(pw);

  if(match(name, pw) == 0)
    welcome();
  else
    goodbye();
}