I am having trouble using srand.
i am trying to generate a random number in the interval 100 to 200.
The number will keep being generated and placed in an array. Once the method is called again the same sequence of random numbers needs to be generated again.
Because of this I need a seed, no matter what I try I cannot seem to get it to work.
I am not looking for anyone to write some code rather just show me the correct formatting for generating such numbers.
UPDATE
I have a train object, which contains a linkedlist(each position in the linedlist is a carriage).
The number of carriages in each train needs to be random in the interval 100, 200.
The amount of coal in each carriage needs to be random in the interval 1000, 2000.
I am trying to implement a simulator class that will create a train with a random amount of carriages which contain a random amount of data.
Hope that makes a bit more sense.
Struggling on how to implement it.