Is there a diffrence between the GetTickCount() and rand() functions ? I read they both are Psuedorandom number generators , I would like to know if there is any diffrence between those two functions , I used rand() once and the output was the same each time the program run , would that change if i use GetTickCount instead ? thankyou very much :)
nico 0 Newbie Poster
Recommended Answers
Jump to PostAdding on, GetTickCount() is also a way to seed the random number generator
srand( GetTickCount() );
Jump to PostAnd GetTickCount() should be something like (depending on the system) the number of 'ticks' since the machine booted. On Windows it it milliseconds since boot, and wraps around every month or two (assuming Windows can stay up that long!).
So it is 'random' in the sense that it will …
All 5 Replies
prog-bman 4 Junior Poster
Emmitt310 0 Newbie Poster
nico 0 Newbie Poster
Chainsaw 12 Posting Pro in Training
nico 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.