I am working on a project that I port some Java code into C. Everything has gone well until now but I'm stucked at porting Random.nextInt(int bound) method into C.
My Java code is:
int arr = new int;
Random r = new Random(0);
for (int i = 0; i < 100000; i++)
arr[i] = r.nextInt(20);
int arr, i;
for (i = 0; i < 100000: i++)
arr[i] = rand() % 20;
Java JDK sources are publicly available.
If you want an exact equivalent of Java's random number generator in C, go grab the sources and write/port it yourself.