Created
November 30, 2016 15:27
-
-
Save AndyNovo/7f701618b32e54414d40f2932893b177 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdbool.h> | |
bool isPasswordOK(void) { | |
char Password[12]; | |
gets(Password); | |
return 0 == strcmp(Password, "goodpass"); | |
} | |
int main(void) { | |
bool pwStatus; | |
puts("Enter Password: "); | |
pwStatus = isPasswordOK(); | |
if (pwStatus == false) { | |
puts("Access denied"); | |
return -1; | |
} | |
else { | |
puts("Access granted!"); | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment