Question: Description Password validator Write a program which takes in password attempts from a 4 #define MAX_BUFFER_SIZE 80 user (via stdin ) until the user enters

 Description Password validator Write a program which takes in password attempts

Description Password validator Write a program which takes in password attempts from a 4 \#define MAX_BUFFER_SIZE 80 user (via stdin ) until the user enters "password1" followed by a newline, or until they close the stdin of the program. If the user guessed the correct password print: Password correct! if they close stdin print: Login failed! if they guessed an incorrect password continue reading in 1112 char* password = fgets (buffer, MAX_BUFFER_SIZE, stdin); more attempts 13// Write your while loop here str, int size, FILE* stream) can be used to get a line 16 \} entered into the terminal (standard input) by the user. The 17 is. You can detect if stdin is closed by checking whether fgets() returns NULL. Note that there will be a newline (character ) on the end of the string returned by fgets() so make sure you account for this when you're checking whether the input /home/validate.c Spaces: 4 (Auto) matches the password

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!