#include <stdio.h> #include <conio.h> #include <string.h> void main() { const char *pers_nr = "666"; //Zugangsnr (MAXIMAL 8 ZEICHEN) const char *code = "drin"; //Zugangscode (MAXIMAL 8 ZEICHEN) char *ab_pers; //Abgefragte Zugangsnr char *ab_code; //Abgefragter Zuganscode int i = 0; //Schleifendurchläufe int codeguard; //Rückgabewert des Stringvergleiches for(i=0;i<3;) { printf(" ENTRY TO PENTAGON\n"); printf(" ~~~~~~~~~~~~~~~~~\n"); ab_pers = getpass(" IDNR: "); printf(" \n"); codeguard = strcmp(pers_nr, ab_pers); if((codeguard > 0) || (codeguard < 0)) { i++; gotoxy(45, 30); printf("!! WRONG IDNR !!\n"); gotoxy(45, 31); printf("!! ACCESS DENIED !!\n "); if(i == 3) { gotoxy(45, 33); printf("!! SYSTEM ABBORTED !!\n\a "); getch(); continue; } else { getch(); clrscr(); continue; } }//if ab_code = getpass(" PASSWORD: "); printf(" \n"); codeguard = strcmp(code, ab_code); if((codeguard > 0) || (codeguard < 0)) { i++; gotoxy(45, 30); printf("!! WRONG PASS !!\n"); gotoxy(45, 31); printf("!! ACCESS DENIED !!\n "); if(i == 3) { gotoxy(45, 33); printf("!! SYSTEM ABBORTED !!\n\a "); getch(); continue; } else { getch(); clrscr(); continue; } }//if gotoxy(45, 30); printf("!! ACCESS GRANTED !!\n\a "); i = 3; getch(); }//for }//main