Skip to content

Instantly share code, notes, and snippets.

@AndyNovo
Created November 30, 2016 15:27
Show Gist options
  • Save AndyNovo/7f701618b32e54414d40f2932893b177 to your computer and use it in GitHub Desktop.
Save AndyNovo/7f701618b32e54414d40f2932893b177 to your computer and use it in GitHub Desktop.
#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