Runtime.cArgs

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

struct Runtime
extern (C) pragma(mangle, "rt_cArgs") static @property @nogc
cArgs
()

Return Value

Type: CArgs

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

Examples

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);
}

Meta