I need to be able to store 5000 names into an array. I currentlyhave a code that generates one random name. I just need to generatean array of 5000 the same way.
#include
#include
#include
#include
using namespace std;
string RandomFirstGen(int namelength);
int main(){
srand(time(NULL));
int namelength = rand()%(16-8+1)+8;
cout<<\"name is:\"<return 0;
}
string RandomFirstGen(int namelength){
for (int i=0; i<=5000 ; i++){
const int MAX = 26;
char alphabet[MAX] = {
'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'};
string name = \"\";
for (int i = 0; i < namelength; i++)
name = name + alphabet[rand() % MAX];
return name;
}
}