So I am trying to generate a random name between 8 and 16 characters. It doesn't need to actually spell a real name it is just a bunch of random letters.
So far I have it to generate a random first and last name but they are all sizes of 12
#include <iostream>
#include <ctime>
using namespace std;
void genID(char letters[26]);
int main()
{
srand(time(0));
char letters[26] = {'a', 'b' ,'c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
genID(letters);
}
void genID(char letters[26])
{
string firstTemp, lastTemp;
for(int i = 0; i < 12; i++)
{
firstTemp = firstTemp + letters[rand() % 26];
lastTemp = lastTemp+ letters[rand() % 26];
}
}
I have code that handles printing out each first and last name respectively through each iteration I just wanted to show the main code of where I need to make the generation between 8 and 16 characters.
Thanks you!