C++ Win32 Console Tutorial 14 - Random Numbers - Randomize srand rand

preview_player
Показать описание

This tutorial shows how to make a random number generator. srand and rand will be used within this tutorial. srand is seed random and must be used outside of this tutorial's loop. srand works with the time function. The time function need ctime to be included in the code. A set of random numbers can be made by using the mod ( %) and adding or subtracting from the rand function's number.

This tutorial uses Visual C++ 2010 Express Running On W7 SP 1
Рекомендации по теме
Комментарии
Автор

Can anyone tell me what the Zero in the srand(time(0)) function stands for ? thx

SuperSamsosa
Автор

So VS2010 Express has the "autocompletion"?
I mean for #include's it displays a list of header names.

VS2008 Express doesn't display it.

jw
Автор

For some reason time is undefined for mine.

hightiernub
Автор

Thanks so much! there are so much noobs out there making tutorials with are useless! lucky you are different!

JannisAdmek
Автор

@007order007 you obviously don't code in c...

SMHS
Автор

using name space "Std"?

lmfao.

order