32位随机字符串的产生错误了
#include <iostream>
#include <CTIME>
using std::cout;
const int SIZE_CHAR = 32; //生成32 + 1位C Style字符串
const char CCH[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main()
{
srand((unsigned)time(NULL));
char ch[SIZE_CHAR + 1] = {0};
int len=RAND_MAX/sizeof(CCH);
//产生10个字符串
for(int j=0;j<10;j++)
{
for (int i = 0; i < SIZE_CHAR; ++i)
{
int x = rand() / (sizeof(CCH) - 1);
ch[i] = CCH[x];
}
cout <<ch <<"\n";
}
return 0;
}