Shows how to use xtd::random::next method.
#include <xtd/console>
#include <xtd/random>
auto main() -> int {
auto male_pet_names =
array {
"Rufus",
"Bear",
"Dakota",
"Fido",
"Vanya",
"Samuel",
"Koani",
"Volodya",
"Prince",
"Yiska"};
auto female_pet_names =
array {
"Maggie",
"Penny",
"Saya",
"Princess",
"Abby",
"Laila",
"Sadie",
"Olivia",
"Starlight",
"Talla"};
auto male_index = rnd.next(male_pet_names.size());
auto female_index = rnd.next(female_pet_names.size());
}
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Represents a pseudo-random number generator, a device that produces a sequence of numbers that meet c...
Definition random.hpp:43
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8