xtd 0.2.0
main4.cpp

Shows how to use xtd::startup class.

#include <xtd/console>
#include <xtd/environment>
#include <xtd/startup>
using namespace xtd;
namespace main4_example {
class program {
public:
static int main(const argument_collection& args) {
// Write arguments to the console output
for (auto arg : args)
return 42;
}
};
}
startup_(main4_example::program::main);
// Is the same as :
//
// auto main() -> int {
// return startup::safe_run(main4_example::program::main);
// }
// This code produces the following output if one two "three four" five are entered on command line:
//
// one
// two
// three four
// five
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:167
xtd::array< xtd::string > argument_collection
Represents the collection of arguments passed to the main entry point method.
Definition argument_collection.hpp:19
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8