So I am working on this for loop(s) here:
for (int i = 0; i < num; i++) {
for (int i = 0; i < length; i++) {
Str += randGen();
}
cout << Str << endl;
}
}
And for context, the integer 'length' is a randomly generated string size. Here is my randGen() function:
static const char combination[] =
"0123456789"
"!@#$%^&*"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
int stringLength = sizeof(combination) - 1;
char randGen() {
return combination[rand() % stringLength];
}
Basically my issue is that if 'num' is greater than one, it will print out the beginning randomly generated part for each one of them the same, and it will not change. The only time there are new randomly generated characters is when the size of 'length' increases, and that is it. However, I want all the STRs to be completely different. Can anyone help me?
--Thx in advance--