Skip to main content
gamedev.net
🔒 Locked

rand function

Started by Fixxer Apr 22, 2006 at 7:50 PM 2 replies 600+ views
Original Post
Fixxer
Fixxer
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));
dave
dave
#include
Boder
Boder
Usually you want to use srand() with the time as the seed, to make what rand() spits out actually pseudo-random and not deterministic.
Fixxer
Fixxer
Thanks Dave, got it to work.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.