How to generate random two digit hexadecimal number?

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

  1. slsh==

    slsh== New Member

    Joined:
    Jun 28, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice