#include <xtd/bit_converter>
#include <xtd/literals>
#include <xtd/console>
auto main() -> int {
const auto formatter = "{0,25}{1,30}";
auto a_double = 0.1111111111111111111;
auto a_single = 0.1111111111111111111f;
auto a_long = 1111111111111111111_s64;
auto an_int = 1111111111;
auto a_short = 11111_u16;
auto a_char = '*';
auto a_bool = true;
console::write_line("This example of methods of the BitConverter class"
"\ngenerates the following output.\n");
console::write_line(formatter, "argument", "byte array");
console::write_line(formatter, "--------", "----------");
console::write_line(formatter, a_double, bit_converter::to_string(bit_converter::get_bytes(a_double)));
console::write_line(formatter, a_single, bit_converter::to_string(bit_converter::get_bytes(a_single)));
console::write_line(formatter, a_long, bit_converter::to_string(bit_converter::get_bytes(a_long)));
console::write_line(formatter, an_int, bit_converter::to_string(bit_converter::get_bytes(an_int)));
console::write_line(formatter, a_short, bit_converter::to_string(bit_converter::get_bytes(a_short)));
console::write_line(formatter, a_char, bit_converter::to_string(bit_converter::get_bytes(a_char)));
console::write_line(formatter, a_bool, bit_converter::to_string(bit_converter::get_bytes(a_bool)));
}
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10