Thread: random function

  1. #16
    Registered User SKeane's Avatar
    Join Date
    Sep 2006
    Location
    England
    Posts
    234
    I know what it is, I was wondering what it was attempting to achieve, but you made the point more eloquently in the second part of your post.

  2. #17
    Registered User
    Join Date
    May 2006
    Posts
    630
    So what would be better to do? Throw cast? Is it better to use c++ style cast instead of c? If so, why?

  3. #18
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >So what would be better to do?
    In this case it would be better not to use the time function to seed your generator at all. For example: http://eternallyconfuzzled.com/articles/rand.html.

    >Is it better to use c++ style cast instead of c?
    There have been heated arguments in favor of both. So it's really up to you.
    My best code is written with the delete key.

  4. #19
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> There have been heated arguments in favor of both. So it's really up to you.
    I don't remember the arguments in favor of C style casts. I would use the C++ ones.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  2. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 01:49 PM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Replies: 5
    Last Post: 02-08-2003, 07:42 PM