Skip to content

Commit

Permalink
Update main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielOrourke02 authored Oct 13, 2023
1 parent 372c869 commit 62e3413
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <cstdlib>
#include <ctime>

// chars for password generation
const char alphanum[] = "0123456789!@#$%^&*abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
// string length variable
int string_length = sizeof(alphanum)-1;

Expand Down Expand Up @@ -42,9 +44,6 @@ void max_generate(int(repeat))

}

// chars for password generation
const char alphanum[] = "0123456789!@#$%^&*abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";

int main()
{
int n; // password length
Expand Down Expand Up @@ -74,8 +73,7 @@ int main()
{
for (int i = 0; i < n; i++)
{
char pass = alphanum[rand() % string_length]; // variable for password generated
std::cout << pass;
std::cout << alphanum[rand() % string_length]; // variable for password generated
}

std::cout << "\n";
Expand Down

0 comments on commit 62e3413

Please sign in to comment.