www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - snprintf

should snprintf be wrapped in vsnprintf? this was the only way I could get my
small program to link.  Without the wrapper I would get this:

Error 42: Symbol Undefined _snprintf



#include <stdio.h>
#include <stdarg.h>

int
snprintf (char *str, int n, char *fmt, ...)
{
va_list a;
va_start (a, fmt);
int ret = vsnprintf (str, n, fmt, a);
va_end (a);
return ret;
}


int
main (void)
{
char b[1024];
int i = snprintf (b, sizeof (b), "%1.1f", 6442452944.1234);
return 0;
}
Dec 31 2004