Good evening, guys.
I am solving an exercise where I must, at each execution, generate a random number and then turn it into letter.
For this I made a function. It is almost all right, the number is generated and is transformed into letter. However, every 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 you need, put the whole code.
Thank you very much