1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

difference between rand() and srand()

Discussion in 'C++' started by ratz, Apr 25, 2011.

  1. ratz

    ratz New Member

    Joined:
    Feb 22, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    hi, could somebody explain for me what the difference is between rand() and srand() in generating numbers
     
  2. enock

    enock New Member

    Joined:
    Apr 28, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    rand function returns numbers between 0 and RAND_MAX
    srand takes an integer seed and jumps to that location in its squence.
     

Share This Page