Random numbers
-
How do you generate random numbers in C++? I C# I had to use a seed and set some range limits/boundaries. .
-
How do you generate random numbers in C++? I C# I had to use a seed and set some range limits/boundaries. .
-
A google search would have found the answer quicker than it takes to open a question here. Please try doing a bit of research first.
k, I`ll keep that in mind next time I post. I still believe in learning by human interaction though.
-
k, I`ll keep that in mind next time I post. I still believe in learning by human interaction though.
-
With rand - C++ Reference[^] function. You can find there few examples.
Thanks
-
Keep it in mind before you post. And if you really want to learn a language there are many useful books and tutorials you can make use of.
Ok
-
Thanks
Do NOT use rand. See <random> - C++ Reference[^]
-
How do you generate random numbers in C++? I C# I had to use a seed and set some range limits/boundaries. .
You may use either the legacy rand()[^] function (with the
srand
one you might provide the seed), or the classes provided by the 'new' random header[^]. The latter is more sophisticated and has a somewhat more difficult interface. You might look at code samples, though, for instance, see the code in this page[^]. -
You may use either the legacy rand()[^] function (with the
srand
one you might provide the seed), or the classes provided by the 'new' random header[^]. The latter is more sophisticated and has a somewhat more difficult interface. You might look at code samples, though, for instance, see the code in this page[^].Thank you CPallini
my name is Calin Negru, I also post on GameDev.net
-
Thank you CPallini
my name is Calin Negru, I also post on GameDev.net