title: generating random numbers - srand c++
body: <p>I am having trouble using srand.</p>
  
  <p>i am trying to generate a random number in the interval 100 to 200.</p>
  
  <p>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.</p>
  
  <p>Because of this I need a seed, no matter what I try I cannot seem to get it to work.</p>
  
  <p>I am not looking for anyone to write some code rather just show me the correct formatting for generating such numbers.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have a train object, which contains a linkedlist(each position in the linedlist is a carriage).</p>
  
  <p>The number of carriages in each train needs to be random in the interval 100, 200.</p>
  
  <p>The amount of coal in each carriage needs to be random in the interval 1000, 2000.</p>
  
  <p>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.</p>
  
  <p>Hope that makes a bit more sense.</p>
  
  <p>Struggling on how to implement it.</p>