srand

This is a discussion on srand within the C++ Programming forums, part of the General Programming Boards category; when using srand function i keep geting the message that writing null inside my brakets is not allowed..but thats what ...

  1. #1
    Unregistered
    Guest

    Unhappy srand

    when using srand function i keep geting the message that writing null inside my brakets is not allowed..but thats what it shows
    srand((unsigned)time(null));
    any helpful hints
    ?

  2. #2
    Fingerstyle Guitarist taylorguitarman's Avatar
    Join Date
    Aug 2001
    Posts
    564
    It's NULL in C++ not null.
    If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    559
    Or, use 0 (zero) instead of NULL

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Use srand() twice in a function?
    By Jake.c in forum C Programming
    Replies: 5
    Last Post: 01-21-2009, 11:51 AM
  2. srand() in .Net
    By Sad Programmer in forum C++ Programming
    Replies: 6
    Last Post: 07-28-2003, 05:01 PM
  3. Same seed for srand yields different results
    By codegirl in forum C++ Programming
    Replies: 3
    Last Post: 06-23-2003, 02:39 PM
  4. When to srand()?
    By Imperito in forum C++ Programming
    Replies: 1
    Last Post: 05-12-2002, 12:20 AM
  5. srand()... possible reasons for failure
    By lightatdawn in forum C++ Programming
    Replies: 3
    Last Post: 12-18-2001, 01:33 AM

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