Is there a function to generate a random int number in C? Or will I have to use a third party library?
Have a look at ISAAC (Indirection, Shift, Accumulate, Add, and Count). Its uniformly distributed and has an average cycle length of 2^8295.