Quote Originally Posted by MustSeeMelons
rand()%4 would give me 0-4
Actually, it will give you integers in the range [0, 3].