请问C如何随机生成[10,25000]的字符串数组???拜托各位大佬🙏!!
请问C如何随机生成[10,25000]的字符串数组???拜托各位大佬🙏!!
#include<stdio.h>
#include<time.h>
#include<stdlib.h>
#include<conio.h>
#define random(x)(rand()%x)
#define N 5
int main()
{
srand(1);
int flag,charLengt;
int i,j,k=0;
char ch[N+1]={NULL};
char zh[N+1]={NULL};
srand((unsigned)time(NULL));
srand(time(NULL));
for(i=0;i<25000;i++){
for(j=0;j<N;j++){
flag=rand()%2;
if(flag)ch[k++]='A'+rand()%26;
else ch[k++]='a'+rand()%26;
}
ch[k]='\0';
k=0;
printf("%d %s %s %s %s %s %s %s %s %s\n",rand(),ch,ch,ch,ch,ch,ch,ch,ch,ch);
}
}