Runtime.cArgs

CArgs cArgs() @property @nogc

Returns the unprocessed C arguments supplied when the process was started. Use this when you need to supply argc and argv to C libraries.

Returns

A CArgs struct with the arguments supplied when this process was started.

Example:

import core.runtime;

// A C library function requiring char** arguments
extern(C) void initLibFoo(int argc, char** argv);

void main()
{
   auto args = Runtime.cArgs;
   initLibFoo(args.argc, args.argv);
}