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

Shows how to use xtd::version to get the Operating System version.

#include <xtd/console>
#include <xtd/environment>
#include <xtd/startup>
using namespace xtd;
namespace version_os_example {
class program {
public:
// The main entry point for the application.
static auto main() {
// Get the operating system version.
auto os = environment::os_version();
auto ver = os.version();
console::write_line("Operating System: {0} ({1})", os.version_string(), ver.to_string());
}
};
}
startup_(version_os_example::program::main);
// This code can produce the following output :
//
// Operating System: macOS 11.6.0 (11.6.0.0)
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.h:175
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10