c++ generate random char
char cch = 'a' + rand()%26;
c++ generate random char
char cch = 'a' + rand()%26;
getting a random letter in c++
char c;
int r;
srand (time(NULL)); // initialize the random number generator
for (i=0; i<num; i++)
{ r = rand() % 26; // generate a random number
c = 'a' + r; // Convert to a character from a-z
cout << c;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us