1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to generate random two digit hexadecimal number?

Discussion in 'C' started by slsh==, Jun 28, 2010.

  1. slsh==

    slsh== New Member

    Jun 28, 2010
    Likes Received:
    Trophy Points:
    How would I make my program generate a random two digit hexadecimal number?

    The number could be anything with two digits except these:
    00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff 08 19 2a 3b 4c 5d 6e 7f 80 91 a2 b3 c4 d5 36 f7

    My program runs in a loop and every time it starts over, I want it to randomly set a variable to a two digit hexadecimal number except for the ones I listed above. It does not matter if it chooses the same thing twice in a row or something like that, but I don't want it to have a pattern in choosing these numbers.

Share This Page