0

First, yes this is a school project. That said, I have a seed, now I need to create a function that will create a byte array of random bits. The input for the function should be the number of requested random bits.

Here's an example:

unsigned char* getRandomBits (int number);

number is number of random bits requested.

Any tips would be appreciated.

Thanks.

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by cableguy414
0

Ok, so I can generate a random number with rand() and then mod 2 to get a random bit. Then get another random number mod 2 for bit two, and so on...

I can do that...

Thanks!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.