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

Shows how to use xtd::string::sprintf method.

#include <xtd/console>
#include <xtd/environment>
#include <xtd/string>
using namespace xtd;
auto main() -> int {
console::out << string::sprintf("%i", 42) << environment::new_line;
console::out << string::sprintf("%u", 42u) << environment::new_line;
console::out << string::sprintf("%d", 42) << environment::new_line;
console::out << string::sprintf("0%o", 42) << environment::new_line;
console::out << string::sprintf("0x%04x", 42) << environment::new_line;
console::out << string::sprintf("0x%04X", 42) << environment::new_line;
}
// This code produces the following output :
//
// 42
// 42
// 42
// 052
// 0x002a
// 0x002A
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10