Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #generate #random #letter
ADD COMMENT
Topic
Name
6+3 =