/* 2010-05-17 johnpfeiffer
convert-string (ansi char to wide char)
wchar_t (32 bit) is the default for windows programs */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main( int argc, char* argv[] )
{
int charCount;
char ansichars[100];
wchar_t widechars[100];
strcpy( ansichars , "test" );
printf("multi character array = %s\n" , ansichars );
/* multi byte string to wide char string
fun trivia, many c functions parameters resemble:
destination = source */
charCount = mbstowcs( widechars , ansichars , 100);
printf("%d chars from multi wide character array after mbstowcs() = %ls\n", charCount , widechars);
/* nChars = wcstombs( ansichars , widechars , 100); */
return 0;
} /* end main */
/* sprintf appends a null char to the end */
/*
char temp[16];
wchar wtemp[16];
sprintf( temp ,"%d", i);
wsprintf( wtemp , "hello" )
*/