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

16
22


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

Nguồn:https://dothihoa.com/

16 COMMENTS

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

    VS2008 Express doesn't display it.

LEAVE A REPLY

Please enter your comment!
Please enter your name here