randomize hex digits

This is a discussion on randomize hex digits within the C Programming forums, part of the General Programming Boards category; is it possible to randomize hex numbers, much the same way rand()/srand() randomize decimal? I assume if its possible, you ...

  1. #1
    Registered User wazilian's Avatar
    Join Date
    Oct 2001
    Posts
    26

    randomize hex digits

    is it possible to randomize hex numbers, much the same way rand()/srand() randomize decimal? I assume if its possible, you would use rand()/srand(), but not sure. Thanks in advance.
    wazilian
    King of Wazil

  2. #2
    still a n00b Jaguar's Avatar
    Join Date
    Jun 2002
    Posts
    187
    Just don't forget to put
    Code:
      unsigned seed=time(NULL);
      srand(seed);
    Again, don't worry about seed base.
    slackware 10.0; kernel 2.6.7
    gcc 3.4.0; glibc 2.3.2; vim editor
    migrating to freebsd 5.4

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    The base of a number is merely for viewing purposes, it is all 0's and 1's underneath it all.

  4. #4
    Just a Member ammar's Avatar
    Join Date
    Jun 2002
    Posts
    953
    Why don't you randomize an integer, then convert to decimal.
    Or I didn't understand the question.
    none...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ascii to hex and hex to Ascii
    By beon in forum C Programming
    Replies: 1
    Last Post: 12-26-2006, 05:37 AM
  2. Hex Editing help and information please...
    By SG57 in forum C Programming
    Replies: 9
    Last Post: 06-25-2006, 12:30 AM
  3. Replies: 11
    Last Post: 03-24-2006, 10:26 AM
  4. Replies: 3
    Last Post: 01-23-2006, 06:25 PM
  5. Hex digits stored in char array.
    By Kevinmun in forum C Programming
    Replies: 8
    Last Post: 11-18-2005, 03:05 PM

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