#include <iostream>
std::string rand_string(size_t size) {
const char charset[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
srand(time(NULL));
std::string s;
s.reserve(size);
for (int i = 0; i < size; ++i)
s += charset[rand() % (sizeof(charset) - 1)];
return s;
}
int main(void) {
std::string s = rand_string(5);
std::cout << s;
return 0;
}
/*
run:
uIzcz
*/