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

  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