level 9
home寻梦到天涯
楼主
C语言的记号
C程序由各种令牌,令牌可以是关键字,标识符,常量,字符串文字或符号。例如,下面的C语句包含五个令牌:
printf("Hello, World! \n");
The individual tokens are:
printf ( "Hello, World! \n" ) ;
分号 ;
In C program, the semicolon is a statement terminator. That is, each individual statement must be ended with a semicolon. It indicates the end of one logical entity.
For example, following are two different statements:
printf("Hello, World! \n"); return 0;
注释
Comments are like helping text in your C program and they are ignored by the compiler. They start with /* and terminates with the characters */ as shown below:
/* my first program in C */
You can not have comments with in comments and they do not occur within a string or character literals.
标识符
C标识符是用来标识变量,函数的名称,或任何其它用户定义的项目。开始的标识符以字母A到Z或a〜z或下划线_由零个或多个字母,下划线和数字(0〜9)。
C does not allow punctuation characters such as @, $, and % within identifiers. C is a case sensitiveprogramming language. Thus Manpower and manpower are two different identifiers in C. Here are some examples of acceptable identifiers:
mohd zara abc move_name a_123 myname50 _temp j a23b9 retVal
关键字
The following list shows the reserved words in C. These reserved words may not be used as constant or variable or any other identifier names.
auto else long switch
break enum register typedef
case extern return union
char float short unsigned
const for signed void
continue goto sizeof volatile
default if static while
do int struct _Packed
double
C语言中的空白行
A line containing only whitespace, possibly with a comment, is known as a blank line, and a C compiler totally ignores it.
Whitespace is the term used in C to describe blanks, tabs, newline characters and comments. Whitespace separates one part of a statement from another and enables the compiler to identify where one element in a statement, such as int, ends and the next element begins. Therefore, in the following statement:
int age;
必须有至少一个空白字符(通常是int和年龄的编译器能够区分它们之间有一个空格)。另一方面,在下面的语句
fruit = apples + oranges; // get the total fruit
2015年04月15日 17点04分
1
C程序由各种令牌,令牌可以是关键字,标识符,常量,字符串文字或符号。例如,下面的C语句包含五个令牌:
printf("Hello, World! \n");
The individual tokens are:
printf ( "Hello, World! \n" ) ;
分号 ;
In C program, the semicolon is a statement terminator. That is, each individual statement must be ended with a semicolon. It indicates the end of one logical entity.
For example, following are two different statements:
printf("Hello, World! \n"); return 0;
注释
Comments are like helping text in your C program and they are ignored by the compiler. They start with /* and terminates with the characters */ as shown below:
/* my first program in C */
You can not have comments with in comments and they do not occur within a string or character literals.
标识符
C标识符是用来标识变量,函数的名称,或任何其它用户定义的项目。开始的标识符以字母A到Z或a〜z或下划线_由零个或多个字母,下划线和数字(0〜9)。
C does not allow punctuation characters such as @, $, and % within identifiers. C is a case sensitiveprogramming language. Thus Manpower and manpower are two different identifiers in C. Here are some examples of acceptable identifiers:
mohd zara abc move_name a_123 myname50 _temp j a23b9 retVal
关键字
The following list shows the reserved words in C. These reserved words may not be used as constant or variable or any other identifier names.
auto else long switch
break enum register typedef
case extern return union
char float short unsigned
const for signed void
continue goto sizeof volatile
default if static while
do int struct _Packed
double
C语言中的空白行
A line containing only whitespace, possibly with a comment, is known as a blank line, and a C compiler totally ignores it.
Whitespace is the term used in C to describe blanks, tabs, newline characters and comments. Whitespace separates one part of a statement from another and enables the compiler to identify where one element in a statement, such as int, ends and the next element begins. Therefore, in the following statement:
int age;
必须有至少一个空白字符(通常是int和年龄的编译器能够区分它们之间有一个空格)。另一方面,在下面的语句
fruit = apples + oranges; // get the total fruit