Help, I am trying to export this code from C to a txt redirecting the output when executing it from the cmd, but it hangs up I think because they are too much data (50,000): s what should I do? including variables
char *nombre_alumno[]
char *sexo_alumno[]
You can not even see the code in yellow as in the photo, it appears all white as if you did not recognize it as an arrangement ** There, in the picture, I wrote that after the names and the sex, another 50,000 values followed.
int main()
{
char *nombre_alumno[] = {"Zina","Bartley","Primavera",.......,>>>50.000 datos mas<<,....};
char *sexo_alumno[] = {"f","m","f","m","m","f",....,>>>50.000 datos mas<<<,....};
int i;
srand (getpid()); //Semilla para generar números aleatorios
for(i=0;i<(sizeof(nombre_alumno)/sizeof(nombre_alumno[0]));i++)
{
printf("INSERT INTO ALUMNO VALUES (%d,'%s',%d,%d,'%s',%s);\n"
,Matricula_alumno,nombre_alumno[i],NUMEROS_AL_EDAD(),NUMEROS_AL_SEMESTRE(),sexo_alumno[i],NUMEROS_AL_CARRERA());
}
}
int NUMEROS_AL_EDAD()
{
int num;
//numero = rand () % (N-M+1) + M; // Este está entre M (valor minimo) y N (valor maximo)
num = rand() % 54 + 17; //Numeros aleatorios entre 17 y
num = num + 1;
return num;
}
int NUMEROS_AL_SEMESTRE()
{
int num;
num = rand() % 11 + 1; //Numeros aleatorios entre 1 y 12
num = num + 1;
return num;
}
int NUMEROS_AL_CARRERA()
{
int num;
num = rand() % 13 + 1; //Numeros aleatorios entre 1 y 13
num = num + 1;
return num;
}