xtd 0.2.0
Loading...
Searching...
No Matches
console_out.cpp

Shows how to use xtd::console::out stream.

#include <xtd/console>
#include <xtd/environment>
#include <xtd/int32_object>
using namespace xtd;
auto main() -> int {
console::out << "Hello, " << "World!" << environment::new_line;
console::out << "Value = " << 42 << environment::new_line;
console::out << "Value (Hex) = 0x" << int32_object(42).to_string("X") << environment::new_line;
console::out << "Current date = " << date_time::now() << environment::new_line;
console::out << "DayOfWeek = " << day_of_week::monday << environment::new_line;
console::out << "Duration = " << 23_h + 5_min + 24_s << environment::new_line;
}
// This code produces the following output :
//
// Hello, World!
// Value = 42
// Value (Hex) = 0x2A
// Current date = Tue Jul 4 15:30:02 2023
// DayOfWeek = (unregistered)
// Duration = 23:05:24
Represents a boxed integer object.
Definition box_integer.h:52
xtd::string to_string() const noexcept override
Returns a xtd::string that represents the current object.
Definition box.h:109
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10