求解这个代码的意思,及要实现的功能
程序代码:
string GetRandomString() { const int SIZE_CHAR = 8; //生成32 + 1位C Style字符串 const char CCH[] = "0123456789abcdefghijklmnopqrstuvwxyz"; srand((unsigned)time(NULL)); char ch[SIZE_CHAR + 1] = {0}; for (int i = 0; i < SIZE_CHAR; ++i) { int x = rand() / (RAND_MAX / (sizeof(CCH) - 1)); ch[i] = CCH[x]; } return ch; }