WriteFile issue

  • Thread starter Thread starter Guest
  • Start date Start date
Thanks David,


You mean MBCS is always ends with 0 and I can use strlen safely?

And for the sizeof (TCHAR), could I assume it is always 2 bytes? Are there
any exceptions?


regards,
George
 
George said:
Thanks David,

You mean MBCS is always ends with 0 and I can use strlen safely?

And for the sizeof (TCHAR), could I assume it is always 2 bytes? Are there
any exceptions?

George:

The whole point of TCHAR is that it is one byte in ANSI build and 2
bytes in Unicode build. This is what enables you to use a single code
base for either kind of build.

If you always use Unicode build, then sizeof(TCHAR) is always 2 (and you
can just use wchar_t and L"" strings). But for me, old habits die hard,
and I always use TCHAR and _T("") strings.
 
Back
Top