• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Random number
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Random number


  • Subject: Re: Random number
  • From: Andrew Pinski <email@hidden>
  • Date: Fri, 11 Jul 2003 10:51:54 -0400

Actually he needs to use srandom(time(NULL)) since he is using random, and not rand.

Thanks,
Andrew Pinski

On Friday, Jul 11, 2003, at 10:40 US/Eastern, Marc Weil wrote:

Use srand(time(NULL)) to seed the random number generator. Make sure that
you #include <time.h> and <math.h>.

- Marc Weil


On 7/11/03 10:30 AM, "Toon Van Acker" <email@hidden> wrote:

I can get a random number using random(), but it stays the same. What I
mean is: I'm creating objects which should have random coordinates, but
every one of them has the same coordinates.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Random number (From: Marc Weil <email@hidden>)

  • Prev by Date: Pasteboard substitution
  • Next by Date: Re: Random number
  • Previous by thread: Re: Random number
  • Next by thread: Re: Random number
  • Index(es):
    • Date
    • Thread