What's the difference between char and CHAR in MSVC?
I hea开发者_Go百科rd that these 2 types (char and CHAR) are different in MSVC, what's the difference between them? And which one is recommended to use if they are different?
There is no actual difference. CHAR
is a typedef to char
, and its part of the Windows API not technically MSVC. See Windows Datatypes at MSDN.
All of the (well most all) Windows API functions use parameters types that are defined in in the Win32 API header files than direct C types. I've always assumed that this was to be able to support multiple compilers (MSVC hasn't always been the dominant C compiler for Windows)
精彩评论