Differences between char, wchar_t, wchar, tchar, and Achar

Source: Internet
Author: User

CHAR:
ANSI string, which can be strcat (), strcpy (), strlen (), and other functions with str headers.

Wchar_t:
Wchar_t is the data type of Unicode characters. Its actual definition is: typedef unsigned short wchar_t;
Wchar_t can be used as a string processing function: wcscat (), wcscpy (), wcslen (), and other functions that are headers with WCS.

Wchar:
The header file has the following definition: typedef wchar_t wchar; therefore, wchar is actually wchar_t.
_ Unicode macros (with underscores) are provided in the C language, and Unicode macros (without underscores) are provided in windows. If _ Unicode macros and Unicode macros are specified, the system automatically switches to the Unicode version. Otherwise, the system compiles and runs in ANSI mode. Only macros are defined and cannot be automatically converted. It also requires support for a series of character definitions.

Tchar:
If a unicode macro is defined, tchar is defined as wchar_t. Typedef wchar_t tchar; otherwise, tchar is defined as char typedef char tchar;

Achar:
This type is defined by Autodesk in the adachar. h header file.
Wchar_t when ad_unicode is defined (Autodesk uses Unicode macros.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.