Shows how to use xtd::random::next_bytes method.
#include <xtd/console>
#include <xtd/random>
 
 
auto main() -> int {
  
  rnd2.next_bytes(bytes2);
  
  console::write_line("First Series:");
  for (auto i = 0ul; i < bytes1.size(); i++) {
    console::write("{, 5}", bytes1[i]);
    if ((i + 1) % 10 == 0)
      console::write_line();
  }
  
  console::write_line();
  console::write_line("Second Series:");
  for (auto i = 0ul; i < bytes2.size(); i++) {
    console::write("{, 5}", bytes2[i]);
    if ((i + 1) % 10 == 0)
      console::write_line();
  }
}
 
Represents a strongly typed list of objects that can be accessed by index. Provides methods to search...
Definition list.hpp:71
 
Represents a pseudo-random number generator, a device that produces a sequence of numbers that meet c...
Definition random.hpp:40
 
virtual void next_bytes(std::vector< xtd::byte > &buffer) const
Fills the elements of a specified array of bytes with random numbers.
 
The xtd::collections::generic namespace contains interfaces and classes that define generic collectio...
Definition comparer.hpp:15
 
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10