1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
/* swprintf example */
#include <stdio.h>
#include <wchar.h>
int main ()
{
wchar_t buffer [100];
int cx;
cx = swprintf ( buffer, 100, L"The half of %d is %d", 80, 80/2 );
swprintf ( buffer+cx, 100-cx-1, L", and the half of that is %d.", 80/2/2 );
fputws ( buffer, stdout );
return 0;
}
|