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)