/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* This program uses swprintf to format various
 * data and place them in the string named buffer.
 */

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

int main()
{
   wchar_t  buffer[200], s[] = L"computer", c = L'l';
   int   i = 35, j;

   /* Format and print various data: */
#if _Win32
#define swprintf _vsnwprintf
#endif
   j  = swprintf( buffer,    200, L"\tString:    %s\n", s );
   j += swprintf( buffer + j,200, L"\tCharacter: %c\n", c );
   j += swprintf( buffer + j,200,L"\tInteger:   %d\n", i );

   printf( "Output:\n%S\ncharacter count = %d\n", buffer, j );

   return 0;
}
