get random character c++ code example
Example 1: c++ generate random char
char cch = 'a' + rand()%26;
Example 2: C++ generate a random letter
#include <iostream>
int main() {
srand(time(0));
std::cout <<"random uppercase = " << char('A' + rand() % 26) << std::endl;
// or
std::cout <<"random uppercase = " << char('a' + rand() % 26) << std::endl;
}