Common Data Type

Lingling Yang
Jan 3, 2022

--

  1. char, wchar_t, char8_t, char16_t and char32_t

The types char, wchar_t, char8_t, char16_t, and char32_t are built-in types that represent alphanumeric characters, non-alphanumeric glyphs, and non-printing characters.

char ch1{'a'}; // or {u8'a'}
wchar_t ch2{L'a'};
char16_t ch3{u'a'};
char32_t ch4{U'a'};

In the Microsoft compiler, char is an 8-bit type.

The wchar_ttype is an implementation-defined wide character type.

2. LPWSTR: The LPWSTR type is a 32-bit pointer to a string of 16-bit Unicode characters, which MAY be null-terminated.

typedef wchar_t* LPWSTR, *PWSTR

3. LPCWSTR: An LPCWSTR is a 32-bit pointer to a constant string of 16-bit Unicode characters, which MAY be null-terminated.

typedef const wchar_t* LPCWSTR;

--

--