Re: idiom for C error strings

2015-07-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 21 July 2015 at 12:40:37 UTC, Daniel Kozák wrote: static: char[size] buf; somefun(param1, buf.ptr, buf.length); still works there too. That's the form I prefer to use.

idiom for C error strings

2015-07-21 Thread yawniek via Digitalmars-d-learn
whats the proper way to use/wrap C functions that expect a error string buffer e.g.: somefun(T param1, char* errstr, size_t errstr_size) in D ?

Re: idiom for C error strings

2015-07-21 Thread Daniel Kozák via Digitalmars-d-learn
On Tue, 21 Jul 2015 12:27:55 + yawniek dl...@srtnwz.com wrote: whats the proper way to use/wrap C functions that expect a error string buffer e.g.: somefun(T param1, char* errstr, size_t errstr_size) in D ? dynamic: auto buf = new char[size]; somefun(param1, buf.ptr,