Symbol (note + escape character + continuation character)

Source: Internet
Author: User

The comment character:

1#include <stdio.h>2 intMain ()3 {4     int/*...*/I//int i;5     Char* s ="abcdefgh//hijklmn";//S[]=ABCDEFGH//HIJKLMN; 6     //is it a \7Valid comment?//is it a valid comment? 8     inch/*...*/t i;//In t i; 9     return 0;Ten}

Annotation rules:

The annotation is not handled in a simple way, but instead of a space.

The comment is no longer treated as a comment if it appears in double quotation marks

The line break in the note uses the "\"

/*....*/cannot be nested

/with a combination of *, that is/*, the compiler treats it as the front end of the comment, waiting for a */End comment (y/*x: not Y/(*x))

Continuation conforms to escape character:

Continuation character: "\", used to tell the compiler that one line is not finished, the next line is the continuation of this line, the next line of the first character instead of the continuation connect prompt behind.

1 int abc[]=2"abcddadfaa";   //

Useful: Define macro code blocks that are commonly used. Because # define requires a row definition to complete

1#include <stdio.h>2 3 #defineSWAP (A, B)4 {                 5     inttemp =A;6A =b; 7b =temp; 8 }9 Ten intMain () One { A     intA =1; -     intb =2; -      the SWAP (A, b); -      -printf"a=%d, b=%d\n", A, b); -      +     return 0; -}

Escape character: (\)
Used to denote no echo characters: \t,\n,\\,,\b ....

\hhh:1-3 bit 8 binary number corresponding to the character; \xhh:1-2 bit 16 binary corresponding character

How the transfer character is distinguished from the continuation character:

Continuation character: Used alone

Transfer character: Use with other characters

Symbol (note + escape character + continuation character)

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.