Hi have made some code that will generate alphanumeric passwords and output them into a file. Each password size has its own function so i have 16 functions for sizes 1-16. The code works great its just that as you go up one size in the password size it will increases the time it takes to process by a factor of 96. I was wondering if i was going the long way around or its just a lot of possibilities and I'm SOL
void PassList3()
{
int counter = 0;
char password[4];
for (int i = 0; i < 4; i++) // sets all char in the array to 0 before starting
{
password[i] = 0;
}
ofstream fout("Password List 3.txt");
for (int place1 = 32; place1 < 128; place1++) // using integer assignment to set the character
{
password[0] = place1;
for (int place2 = 32; place2 < 128; place2++)
{
password[1] = place2;
for (int place3 = 32; place3 < 128; place3++)
{
password[2] = place3;
fout << password << "\n";
cout << password << "\t\t" << counter << "\n";
counter++;
}
}
}
fout.close();
cout << "\nPasswords saved in: Password List 3.txt";
}
any help would be appreciated.