Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO GENERATE A RANDOM 8 BIT STRING

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
How can I generate a random 8 bit string.

Thank You!
 
well, the approach I would take is to generate a random number between 0 and 255 and then have a function to convert to string. The other approach would be to generate 8 random numbers between 0 & 1 but I tend to see that the rand function does not behave very randomly with small numbers.

Matt

P.S. But remember, an 8 bit string is not really 8 bits... it is 8 bytes.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top