C++/c program help
Expert: vijayan - 11/11/2008
QuestionWriting a C program (call it RandPass.c) which can generate such passwords from 6 to 12 characters in length. The program should ask the user to enter the length of the password and then produce then produce the generated password.
sample:Password generating program
Enter the length of the password: 12
Your new password is: Lq5wIo69XhkJ
Answer1. write a function to generate a random printable character
a. generate a random int in the range 0 - CHAR_MAX (use modulus operator)
b. check if the char is printable: use the isprint function.
if yes, return the char
if no, repeat the above
2. in main, allocate a buffer to hold 13 chars
3. accept the length of the password from the user
4. in a loop, call the function to generate random printable characters
5. put a null character at the end of the generated chars.
6. print out the buffer as a (c style) string, and you are done