cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Generator
Generator
Jun 29, 2013 at 12:18pm UTC
Jayzen
(1)
Write your question here.
Hey guys please help me whit this ..how can i generate A random names in c++
as an example You type 10 names the programe needs to genrate and pick randomly 5 names ...thanx for advance
Jun 29, 2013 at 12:25pm UTC
JLBorges
(13770)
> You type 10 names the programe needs to genrate and pick randomly 5 names
Put the ten names into a
std::vector<std::string>
, shuffle it randomly
http://en.cppreference.com/w/cpp/algorithm/random_shuffle
, and pick the first five names in the sequence.
Topic archived. No new replies allowed.