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

Shows how to use xtd::startup class.

#include <xtd/console>
#include <xtd/environment>
#include <xtd/startup>
using namespace xtd;
namespace main1_example {
class program {
public:
static void main() {
// Write arguments to the console output
for (auto arg : environment::get_command_line_args())
console::write_line(arg);
// return 42
environment::exit_code(42);
}
};
}
startup_(main1_example::program::main);
// Is the same as :
//
// auto main() -> int {
// return startup::safe_run(main1_example::program::main);
// }
// This code produces the following output if one two "three four" five are entered on command line:
//
// /!---OMITTED---!/main1
// one
// two
// three four
// five
#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