xtd 0.2.0
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 << "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
static std::ostream out
Gets the standard output stream. A std::basic_ostream<char_t> that represents the standard output str...
Definition console.hpp:52
static date_time now() noexcept
Gets a xtd::date_time object that is set to the current date and time on this computer,...
static xtd::string new_line() noexcept
Gets the newline string defined for this environment.
box_integer< int32 > int32_object
Represent a boxed int32.
Definition int32_object.hpp:29
@ monday
Indicates monday.
Definition day_of_week.hpp:29
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8