string source = "abcdefghijklmnopqrstuvwxyz";
const size_t length = source.length();
for (uint i = 0; i < 20; i++)
 cout<<source[rand()%length];

こんな感じの乱数文字列生成