What is the simplest way to convert char[] to/from tchar[] in C/C++(ms)?


Question

This seems like a pretty softball question, but I always have a hard time looking up this function because there seem there are so many variations regarding the referencing of char and tchar.

1
18
10/1/2008 8:05:56 PM

Accepted Answer

7
1/1/2017 5:01:02 AM

The simplest way is to use the conversion macros:

  • CW2A
  • CA2W
  • etc...

MSDN


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon