how doe the random() function work? It is not that random because I have exactly the same employees and assets as in the book.


To get random numbers, call the srandomdev function once (when your program starts up) before you call the random function:

srandomdev ();
long randomNumber = random ();

Or simply use the arc4random or arc4random_uniform functions instead.


And why isn’t it like that in the book?