usage of rand()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Orhan Demirel

    usage of rand()

    I use VC++ 6.0 and I try to get random numbers with rand() but it gives me
    same number.There is a solution in C for this problem : randomize( ) but I
    need it in C++.
    If someone tell me how I get random numbers I'll be glad .




  • Adam Fineman

    #2
    Re: usage of rand()

    Orhan Demirel wrote:[color=blue]
    > I use VC++ 6.0 and I try to get random numbers with rand() but it gives me
    > same number.There is a solution in C for this problem : randomize( ) but I
    > need it in C++.
    > If someone tell me how I get random numbers I'll be glad .
    >
    >
    >
    >[/color]
    The solution in C is the same as the solution in C++: srand(), not
    randomize().

    - Adam

    Comment

    Working...