The only way I could think of to do this is to write two conversion functions. One converts an array of chars to wchar_ts and the other goes back. Below is a sample one that I wrote and compiled in MVC++ 5.0. That should work for you.
#include <string.h>
#include <wchar.h>
void wtoc(wchar_t *toConvert, char *str) {
int count = 0;
int len = wcslen(toConvert);
for(; count < len; count++) {
str[count] = (char) toConvert[count];
}
}
void ctow(char *toConvert, wchar_t *wstr) {
int count = 0;
int len = strlen(toConvert);
for(; count < len; count++) {
wstr[count] = (wchar_t) toConvert[count];
}
}
void convert(wchar_t wstr[20]) {
char copy[20];
wtoc(wstr, copy);
printf("%s\n", copy);
}
int main() {
char str[20] = "I hope this works";
wchar_t wstr[20];
ctow(str, wstr);
convert(wstr);
return 1;
}