random number generation
He asked "between" not "inclusive":
rand() % 5 : 0 -> 4 // there are 5 numbers here
rand() % (5 + 1) : 0 -> 5 // there are 6 numbers here
rand() % 5 : 0 -> 4 // there are 5 numbers here
rand() % (5 + 1) : 0 -> 5 // there are 6 numbers here
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement