I\'ve found answers to this question for many programming languages, except for C, using the Windows API. No C++ answers please. Consider the following:
#inc
If you KNOW that the input is pure ASCII and there are no extended character sets involved, there's no need to call any fancy conversion function. All the character codes in ASCII are the same in Unicode, so all you need to do is copy from one array to the other.
#include
char *string = "The quick brown fox jumps over the lazy dog";
int len = strlen(string);
WCHAR unistring[len+1];
int i;
for (i = 0; i <= len; ++i)
unistring[i] = string[i];