#include #include #include #include const char *password = "23door42\n"; int main(void) { size_t input_size = 0; char *input_line = NULL; printf("Please enter Password: "); /* read in password from standard input, exit on error. */ if (getline(&input_line, &input_size, stdin) == -1) { perror("Error"); free(input_line); exit(EXIT_FAILURE); } /* compare password, print info, exit appropriately */ if (strcmp(input_line, password) == 0) { puts("Success!"); free(input_line); exit(EXIT_SUCCESS); } else { puts("How about no?!"); free(input_line); exit(EXIT_FAILURE); } }