#include <iostream>
#include <string> //Needed for strings.
#include <time.h> //Needed for time function.
using namespace std;
int main()
{
string CharacterSet = "lmntuvwxyzABCDEFGghijHIJKLMNOPopqrsQRSTUVWXabcdefkYZ"; //Characters you want to include in the final string. I broke the sequence for better randomization.
string FinalString; //Will store our random characters.
srand (time(NULL)); //Initialize a random seed for randomizer based on the time.
for (int i = 0; i < 6; ++i) //Need 6 characters, so loop 6 times.
{
FinalString += CharacterSet[rand() % (CharacterSet.length())]; //Select a random character from the CharacterSet.
}
cout << FinalString.c_str() << endl << endl; //Display the string by converting it into c style string.
system("PAUSE"); //Pause this shit.
}
char *random_string(int len)
{
char *alphabet = "lmntuvwxyzABCDEFGghijHIJKLMNOPopqrsQRSTUVWXabcdefkYZ";
int alphaLen = (int)strlen(alphabet);
char *random = (char*)calloc(1, len + 1);
for(int i = 0; i < len; i++)
random[i] = alphabet[rand() % alphaLen];
return random;
}
srand(time(NULL)); char *random1 = random_string(10); char *random2 = random_string(10); //note, no further calls to srand. free(random1); free(random2); //free calloc'd memory.

char *random_string(int len)
{
char *alphabet = "lmntuvwxyzABCDEFGghijHIJKLMNOPopqrsQRSTUVWXabcdefkYZ";
int alphaLen = (int)strlen(alphabet);
char *random = new char[len + 1];
for(int i = 0; i < len; i++)
random[i] = alphabet[rand() % alphaLen];
random[len] = '\0';
return random;
}