Hello again:
I modified my sample program, and changed the last line to use wprintf instead of printf:
#include <stdio.h>
#include <stdlib.h>
#include <wchar.h>
int main(void)
{
char path [FILENAME_MAX];
char drive[] = "C:";
char dir [] = "\\foldername\\";
char name [] = "filename";
char ext [] = "txt";
_makepath(path, drive, dir, name, ext);
printf("%s \n", path);
wchar_t wpath [FILENAME_MAX];
wchar_t wdrive[] = L"C:";
wchar_t wdir [] = L"\\foldername\\";
wchar_t wname [] = L"filename";
wchar_t wext [] = L"txt";
_wmakepath(wpath, wdrive, wdir, wname, wext);
wprintf(L"%ls \n", wpath);
return 0;
}
now wprintf does not give any output. The output for the program is just
C:\foldername\filename.txt (the printf at the beginning)
so, is the handling of wchar_t type not reliable?