random function

This is a discussion on random function within the C++ Programming forums, part of the General Programming Boards category; I know what it is, I was wondering what it was attempting to achieve, but you made the point more ...

  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
    l2u
    l2u is offline
    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,796
    >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,344
    >> 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.

Page 2 of 2 FirstFirst 12
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, 04: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, 07:39 AM
  5. Replies: 5
    Last Post: 02-08-2003, 07:42 PM

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