觅风论坛

标题: C++ 宽字符TCHAR获取随机字符 [打印本页]

作者: 小一    时间: 2022-4-2 15:26
标题: C++ 宽字符TCHAR获取随机字符
char c[37] = { "abcdefghijklmnopqrstuvwxyz0123456789" };
void random(TCHAR nongfeitian[11]) {
        srand(time(0));//当前时间做种子
        for (int i = 0; i < 10; i++) {
                nongfeitian[i] = c[rand() % 36];
        }
}






欢迎光临 觅风论坛 (https://www.eyyba.com/) Powered by Discuz! X3.4