random number generator

I

iandigges

I need a random number generator to produce a 0 or 1 that I can feed
into a multidimensional array. Any hints?

~ Ian
 
V

Victor Bazarov

I need a random number generator to produce a 0 or 1 that I can feed
into a multidimensional array. Any hints?

int rand_bit()
{
return rand() > RAND_MAX / 2;
}

V
 
Z

Zeppe

I need a random number generator to produce a 0 or 1 that I can feed
into a multidimensional array. Any hints?

use the rand() of the standard library.

Regards,

Zeppe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top