Top "Srand" questions

a function which initializes the pseudo-random number generator in C/C++ or PHP

How do I seed the rand() function in Objective-C?

Part of what I'm developing is a random company name generator. It draws from several arrays of name parts. I …

objective-c ios c random srand
Problems when calling srand(time(NULL)) inside rollDice function

When I used at first srand(time(NULL)) in rollDice() function it did not work. But when I put it …

c random srand
C++ random number from a set

Is it possible to print a random number in C++ from a set of numbers with ONE SINGLE statement? Let's …

c++ random srand
What‘s the difference between srand(1) and srand(0)

I just found out the hard way that srand(1) resets the PRNG of C(++) to the state before any call …

c++ c random srand
What is the most correct way to generate random numbers in C with pthread

I have several threads running concurrently and each of them must generate random numbers. I want to understand if there …

c multithreading random pthreads srand
random_shuffle not really random

I'm using the random_shuffle on a vector like this: #include <algorithm> vector <Card> deck; //some …

c++ random srand