Random numbers the same every time!

This is a discussion on Random numbers the same every time! within the C++ Programming forums, part of the General Programming Boards category; I have a program which generates random cards from deck but when I run it, it says the same every ...

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    16

    Unhappy Random numbers the same every time!

    I have a program which generates random cards from deck but when I run it, it says the same every time!

    How can this be?

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Perhaps you did not seed the random number generator

    Look up srand(..)

  3. #3
    Moderately Rabid Decrypt's Avatar
    Join Date
    Feb 2005
    Location
    Milwaukee, WI, USA
    Posts
    300
    It will take me longer to post this that is did to find this page on google.
    There is a difference between tedious and difficult.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. random numbers
    By mesmer in forum C Programming
    Replies: 4
    Last Post: 10-24-2008, 02:22 PM
  2. Generating a sequence of numbers in a random order
    By mirbogat in forum C Programming
    Replies: 15
    Last Post: 08-12-2008, 03:01 PM
  3. Question about random numbers
    By Kempelen in forum C Programming
    Replies: 2
    Last Post: 07-02-2008, 07:28 AM
  4. Sending an email in C program
    By Moony in forum C Programming
    Replies: 28
    Last Post: 10-19-2006, 11:42 AM
  5. Random Seed without Time function
    By Gabacus in forum C Programming
    Replies: 4
    Last Post: 03-14-2005, 02:13 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21