I\'m trying to call a class function using a loop
for (int i = 0; i < Basket.getLemonNum(); i++) { lemonWeights[i] = Fruit.generateWeight(fruit, fruitWeig
You must call srand() once, whereas you call it on every entry into generateWeight(). Since nowadays computers are fast and time() returns the time in seconds, this mostly restarts the random number generator from the same seed.
srand()
generateWeight()
time()