usage of rand()

Discussion in 'C++' started by Orhan Demirel, Jul 21, 2003.

  1. 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 .
    Orhan Demirel, Jul 21, 2003
    #1
    1. Advertising

  2. Orhan Demirel

    Adam Fineman Guest

    Orhan Demirel wrote:
    > 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 .
    >
    >
    >
    >

    The solution in C is the same as the solution in C++: srand(), not
    randomize().

    - Adam
    Adam Fineman, Jul 21, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. metfan
    Replies:
    2
    Views:
    4,824
    Robert Olofsson
    Oct 21, 2003
  2. Colin J. Williams

    Webchecker Usage - a problem with local usage

    Colin J. Williams, Feb 25, 2004, in forum: Python
    Replies:
    1
    Views:
    510
    Colin J. Williams
    Feb 26, 2004
  3. hvt
    Replies:
    0
    Views:
    1,183
  4. hvt
    Replies:
    0
    Views:
    1,440
  5. 7stud --

    rand() v. rand(0.1) ?

    7stud --, Sep 15, 2007, in forum: Ruby
    Replies:
    6
    Views:
    209
    Morton Goldberg
    Sep 16, 2007
Loading...

Share This Page