Re: Passing variadic arguments to C

2015-02-22 Thread Foo via Digitalmars-d-learn
On Sunday, 22 February 2015 at 17:20:23 UTC, Foo wrote: On Sunday, 22 February 2015 at 17:15:06 UTC, anonymous wrote: On Sunday, 22 February 2015 at 17:09:27 UTC, Foo wrote: Is this possible? Example: void foo(Args...)(auto ref Args args) { sprintf(str.ptr, fmt.ptr, args); } yes

Re: Passing variadic arguments to C

2015-02-22 Thread Foo via Digitalmars-d-learn
On Sunday, 22 February 2015 at 17:15:06 UTC, anonymous wrote: On Sunday, 22 February 2015 at 17:09:27 UTC, Foo wrote: Is this possible? Example: void foo(Args...)(auto ref Args args) { sprintf(str.ptr, fmt.ptr, args); } yes I get the error, that I cannot pass a dynamic array to

Re: Passing variadic arguments to C

2015-02-22 Thread anonymous via Digitalmars-d-learn
On Sunday, 22 February 2015 at 17:09:27 UTC, Foo wrote: Is this possible? Example: void foo(Args...)(auto ref Args args) { sprintf(str.ptr, fmt.ptr, args); } yes

Passing variadic arguments to C

2015-02-22 Thread Foo via Digitalmars-d-learn
Is this possible? Example: void foo(Args...)(auto ref Args args) { sprintf(str.ptr, fmt.ptr, args); }