Is there a function to generate a random int number in C? Or will I have to use a third party library?
If you need better quality pseudo random numbers than what stdlib provides, check out Mersenne Twister. It's faster, too. Sample implementations are plentiful, for example here.
stdlib