• 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: Marc Weil <email@hidden>
  • Date: Fri, 11 Jul 2003 10:40:01 -0400

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.

  • Follow-Ups:
    • Re: Random number
      • From: Andrew Pinski <email@hidden>
References: 
 >Random number (From: Toon Van Acker <email@hidden>)

  • Prev by Date: Re: Xcode - ___gxx_personality_v0 symbol error
  • Next by Date: Pasteboard substitution
  • Previous by thread: Random number
  • Next by thread: Re: Random number
  • Index(es):
    • Date
    • Thread