keep in global.sh:
random_alpha(char* param_name, int length)
{
char buff[32] = "";
int r,i;
char c;
srand((unsigned int)time(0)); //Seed number for rand()
for (i = 0; i < 7; i++)
{
// A-Z = 65-90 = rand() % 25 + 65
r = rand() % 25 + 65;
c = (char)r;
buff[i] = c;
printf("%c", c);
}
lr_save_string(buff, param_name);
}
random_alpha("P_FirstName", 5);
random_alpha(char* param_name, int length)
{
char buff[32] = "";
int r,i;
char c;
srand((unsigned int)time(0)); //Seed number for rand()
for (i = 0; i < 7; i++)
{
// A-Z = 65-90 = rand() % 25 + 65
r = rand() % 25 + 65;
c = (char)r;
buff[i] = c;
printf("%c", c);
}
lr_save_string(buff, param_name);
}
random_alpha("P_FirstName", 5);
No comments:
Post a Comment