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
static @property @nogc
cArgs
()

Return Value

Type: CArgs

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

Examples

1 import core.runtime;
2 
3 // A C library function requiring char** arguments
4 extern(C) void initLibFoo(int argc, char** argv);
5 
6 void main()
7 {
8    auto args = Runtime.cArgs;
9    initLibFoo(args.argc, args.argv);
10 }
Suggestion Box / Bug Report