Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started