random - srand() range not as intended c++ -


i trying generate random 9 digit numbers reason number 1000*****. feel srand good, else must going on?

int ssn = (rand() % 899999999) + 100000000;  

it appears rand_max considerably less nine-digit number. put: values generated rand() small purposes. you'll need use different rng.


Comments

Popular posts from this blog

java - Ebean enhancement ignores a model -

ubuntu - How to disable Kernel Module Signing in linux -

SQL php on different pages to Insert (mysqli) -