Can someone explain why this outputs garbage values?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Dec 9 11:47:23 PST 2014


On Tuesday, 9 December 2014 at 19:44:42 UTC, Dustin wrote:
>     snprintf(dest, 256UL, toStringz(fmt), _argptr);

To forward varargs in C, you need to use a different function: 
vsnprintf instead of snprintf. (The new v at the beginning means 
varargs).

I don't think that's completely compatible with D's varargs 
though, the type C expects is va_list, it might be on 
core.vararg, I'm not sure.


More information about the Digitalmars-d-learn mailing list