[Previo por Fecha] [Siguiente por Fecha] [Previo por Hilo] [Siguiente por Hilo]

[Hilos de Discusión] [Fecha] [Tema] [Autor]

Re: OT: random() en C



Claudio wrote:
> 
>         Perdon por el OffTopic, alguien sabe como puedo
>         inicializar los valores del random() en c, para que
>         no me de los mismos valores siempre que corra un programa.
> 

¿srandom/randomize?  

Si es linux, man random y de ahí:

       The srandom() function sets its argument as the seed for a
       new sequence of pseudo-random integers to be  returned  by
       random().  These sequences are repeatable by calling sran-
       dom() with the same seed value.  If no seed value is  pro-
       vided,  the random() function is automatically seeded with
       a value of 1.

:-)

-- 
Para desuscribirse, mande correo a: ayuda-unsubscribe en linux org mx
Para comandos adicionales, envíelo a: ayuda-help en linux org mx



[Hilos de Discusión] [Fecha] [Tema] [Autor]