How should command-line arguments be used in better C ? Looping through argv seems to print environment variables :

import core.stdc.stdio;

extern(C) int main(int argc, char*[] argv, char*[] env)
{
        foreach(i; 0 .. argc)
                printf("arg %d: %s\n", i, argv[i]);
        return 0;
}


Compiling with v2.076.0-b2-dirty on Lubuntu 14.04 and running with one argument outputs the following :

arg 0: XDG_VTNR=7
arg 1: LC_PAPER=fr_FR.UTF-8

Reply via email to