Can anyone tell me the function of random? And diff btw ramdom() and randomize()? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Can anyone tell me the function of random? And diff btw ramdom() and randomize()?

7th Feb 2017, 5:20 AM
Vaaru
Vaaru - avatar
3 ответов
+ 6
Both random() and randomize() are Borland-style functions. They may still be available on some modern compilers, they are not part of the standard. Their counterparts would be rand() and srand() respectively. The former generates a pseudo-random number while the latter is responsible for seeding the random number generating algorithm.
7th Feb 2017, 6:51 AM
Hatsy Rei
Hatsy Rei - avatar
+ 6
Can you post a sample code? AFAIK you will only be able to identify a possible range of output.
7th Feb 2017, 6:59 AM
Hatsy Rei
Hatsy Rei - avatar
0
but how to identify the correct output when both of them are used in a program
7th Feb 2017, 6:57 AM
Vaaru
Vaaru - avatar