I'm trying to create a random password generator for a homework assignment. The assignment is pretty vague but says to use ascii, rand, srand, and a for loop to create the password.
I have all this info from user: total number of characters, whether or not they want to use uppercase/lowercase/numbers/special characters and what percentage of each they want.
Now I really just don't have a clue how to start the for loop to get it to start building the password. I'm not really sure how to get random ascii numbers corresponding to letters, numbers, and special characters and mashing them together to create a string for the user.
I was thinking maybe starting the loop like this:
for (;chara>0;chara--)
chara is the amount of total letters user wants in their password.
Aucun commentaire:
Enregistrer un commentaire