simulation in visual c++

Discussion in 'C++' started by checkerboard, Feb 18, 2007.

  1. checkerboard

    checkerboard New Member

    Joined:
    Feb 12, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    0
    I have a set of functions which includes a random number generator.

    I wish to do some simulation, that is to repeat the set of functions several times (hence using a different set of random numbers each time).

    How do I go about doing it? I have managed to do 1 simulation, but I need a thousand and I also need to find a way to store the information from each and every simulation.

    thank you for the help.
     
  2. ever_thus

    ever_thus New Member

    Joined:
    Jan 3, 2007
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    0
    Use a for loop to iterate over the functions and store the results in an array.

    That might not be clear but I advise you to find out what those words mean if you want to get far in programming.
     
  3. DaWei

    DaWei New Member

    Joined:
    Dec 6, 2006
    Messages:
    835
    Likes Received:
    5
    Trophy Points:
    0
    Occupation:
    Semi-retired EE
    Location:
    Texan now in Central NY
    Home Page:
    http://www.daweidesigns.com
    Seed the RNG just once, during initialization, or you'll find your 'random' numbers repeating.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice