On Thursday, 27 June 2019 at 17:22:36 UTC, Paul Backus wrote:
On Thursday, 27 June 2019 at 17:20:37 UTC, Paul Backus wrote:
void main(string[] args)
{
string[] defaultArgs = ["my", "default", "arguments"];
if (args.length == 0) {
args = defaultArgs;
}
// Process args...
Is it possible to set the default values for the Main function's
arguments?
It seems that I'm getting Range error.
import std.stdio : writeln;
void main(string[] args = ["asdsfasdf", "asdklfajsdk",
"asdfasdfasd"]){
writeln("", args[1]);
}
Output: