Hi, im fairly new to C++ and would like help with using random number generators, i have heard of them but cant seem to find there code structure.
Any help is greatly appreciated :D
Matthew
0
Newbie Poster
Recommended Answers
Jump to Posthttp://www.agner.org/random/randomc.zip
download that zip of .cpp files
File list
randomc.h
C++ header file containing class definitions.
You must #include this in all C++ files that use this library.mersenne.cpp
Random number generator of type Mersenne twister.ranrotb.cpp
…
Jump to PostYour C++ compiler comes with a random number generator, rand(). There's a tutorial on the site here:
[thread]1769[/thread]
If you're producing a serious application you'll want something a little more sophisticated but for many purposes it's adequate.
All 5 Replies
odious face
0
Newbie Poster
Bob
15
using namespace Bob
Team Colleague
Bitto11
0
Newbie Poster
mitrmkar
1,056
Posting Virtuoso
tesuji
135
Master 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.