rand() function is not really random

This is a discussion on rand() function is not really random within the C Programming forums, part of the General Programming Boards category; I made a dice program using
Code:
dice=rand()%6 + 1;
It gives random values from 1 to 6 but every ...

Manasij Mukherjee | gcc-4.9.2 @Arch Linux Slow and Steady wins the race... if and only if :1.None of the other participants are fast and steady.
2.The fast and unsteady suddenly falls asleep while running !

- Use a more cryptographically secure random generator. Arc4random() is not standard, but it's available on pretty much every Linux/Mac/*nix build I've seen. Also, a whole array of functions like this can be found here > jrand48(3) - Linux man page