Three-character groups for standard C languages and separators for alternate spellings

Source: Internet
Author: User


StandardCThe language includes a set of three-character groups thatClanguage programs can only be usedISO 646-1083The invariant code set is written, which is seven bitsASCIIA subset of the code sets that are common to many non-English-language character sets. The three-character group starts with two consecutive question marks, see. StandardCThe language also provides some token of the re-spelling and defines some operators for the macro replacement header file<iso646.h>, but unlike a three-character group, these substitutions cannot be recognized in string constants and character-type constants.

the conversion of a three-character group in the source program occurs before the lexical analysis (converted to a token) and before the escape character is recognized in the string constant and character type constants. StandardClanguage can only recognize the above9a three-character group, all other character sequences, such as?? &) does not convert. The new escape character\?can be used to prevent the interpretation of a sequence of characters similar to a three-character group.

to help programmers use a language that does not have some American or English charactersI/Odevice, replacing spelling<%,%>,<:,:>,%:,%:%:equivalent to separators, respectively{,},[,],#,##, see.


In the following example, the delimiter uses two forms of the same result:

MAIN.C #include <stdio.h> #define SEASON (SEASON) "SEASON is:" #season #define MONTH "month is:"%:month #d Efine adhere (one, b) one# #two #define LINK (one, both) One%:%:two int main (void) {     char arr[] = {' A ', ' B '};     Char arr2<::> = <% ' C ', ' d '%>;     printf ("%c,%c\n", arr[0], arr[1]); A, B     printf ("%c,%c\n", Arr2<:0:>, arr2<:1:>);//C, D      printf ("%s\n", SEASON ("Summer"));// Season is: "Summer"     printf ("%s\n", Month ("April"));//month ID: "April"     printf ("%d\n", Adhere (1, 2));//12< c13/>printf ("%d\n", LINK (3, 4));     return 0;}


Three-character groups for standard C languages and separators for alternate spellings

Related Article

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.