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 - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -