Guest User

Untitled

a guest
May 20th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. typedef struct {
  2. char pass[6];
  3. int act;
  4. }habi;
  5. habi t[2];
  6. char given_password[] = "000000";
  7.  
  8. t[0].pass[6]= "123123";
  9. t[0].act = 1;
  10. t[1].pass[6]= "123456";
  11. t[1].act = 1;
  12.  
  13. int Check_password(){
  14. found =0;
  15. Lcd_Cmd(_LCD_CLEAR);
  16. for(i=0;i<2;i++){
  17. if(!memcmp(t[i].pass, given_password, 6)){
  18. Lcd_Out(1, 1, "Password Matched");
  19. Lcd_Out(2,1,"elevator is on");
  20. return 1;
  21. found=1;
  22. }
  23. }
  24. if (found==0){
  25. Lcd_Out(1, 1, "Incorrect Password");
  26. Lcd_Out(2, 1, "Try Again!");
  27. Delay_ms(2000);
  28. Password_prompt();
  29. return 0;}
  30.  
  31. }
Add Comment
Please, Sign In to add comment