making args global

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Apr 3 15:41:49 PDT 2012


On 4/4/12, jicman <cabrera at wrc.xerox.com> wrote:
> imagine this code...

I'm assuming you're using D2.

import core.runtime;

void c()
{
    char[] t = Runtime.args[0].dup;
}

void main(char[][] args)
{
    int i = 1;
}

.dup is necessary since Runtime keeps the args as a string[] and not a char[][].


More information about the Digitalmars-d-learn mailing list