Question: Please reivew the code below and explain following code roles played in this program: enum { BUFFERSIZE = 15}; char password[BUFFERSIZE] = ; char cpassword[BUFFERSIZE]

Please reivew the code below and explain following code roles played in this program:

enum { BUFFERSIZE = 15};

char password[BUFFERSIZE] = ""; char cpassword[BUFFERSIZE] = "";

printf_s VS printf

scanf_s("%c", &cont, 1);

printf_s("Length of password is %d ", sizeof(password) - 1);

memcpy_s(cpassword, sizeof(cpassword), password, sizeof(password));

Please reivew the code below and explain following code roles played in

this program: enum { BUFFERSIZE = 15}; char password[BUFFERSIZE] = ""; char

#include #include 4 enum BUFFERSIZE 15 ; 6 // Function prototypes 7 void fillPassword (size t, char[]); 8 void showResults(char); 9 void showMenu(void); 10 11 // Define a variable to hold a password 12 // and the copy 13 char password [BUFFERSIZE]" 14 char cpassword [BUFFERSIZE]""; 15 16 int main (void) 17 18 19 20 21 IWelcome the User printf s("Welcome to the C Array Program!In") IVariables char cont'y'; II TO continue with loop int cVar0; // process variable 23 24 25 26 27 28 29 30 31 32 // Display menu and Get Selection while (cont! 'E' && cont! 'e') // Display the Menu showMenu(); // Get the user selection scanf s("%c", &cont, 1); //No user input accepted; just clears newline char getchar); 34 35 36 37 38 39 40 // Display the menu response showResults (cont); // Call the Copy routine fillPassword(sizeof (password), password); // Display variable values printf-s ("password is %s ", password); printf-s ("cVar is %d ", cvar); printf-s("Length of password is %d ", sizeof (password) 42 43 -1); 45

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!