1
Good night, you guys.
I’m solving an exercise where I must, at each run, generate a random number and then turn it into a letter.
For this I made a function. It is almost all right, the number is generated and is transformed into letter. However, each time I run the program, it always gives the same sequence of numbers/characters. That is, it is not random.
The function code is:
int inserir_fila(int x)
{
char ch;
if (fim_fila<=MAX)
{
x= rand()% 26;
ch= x + 'A';
fim_fila++;
fila[fim_fila]=ch;
}
else
{
printf("Fila Cheia!\n");
}
return(x);
}
If I have to, I’ll put the whole code.
Thank you very much
Now it is no longer repeating, however, it is presenting characters that I cannot present, such as special characters and lowercase letters. PS. I am not using
– Evilmaax