rand function

Started by
2 comments, last by Fixxer 18 years ago
what header is the random function included in? for some reason it isnt working. This is how im using it. SetTextColor(hdc, RGB(rand()%256, rand()%256, rand()%256));
Advertisement
#include <cstdlib>
Usually you want to use srand() with the time as the seed, to make what rand() spits out actually pseudo-random and not deterministic.
Thanks Dave, got it to work.

This topic is closed to new replies.

Advertisement