|
Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006
And the distinction between 安 c c Unix C Unix is Unix k&r achieved in the beginning of the c standards 安 安 c is the normative standards of their (enhanced portability)
Many people do not know the difference between these two kinds of c and confusion, a reference to everyone here, hope to be able to help.
1. Delete the keyword
安 delete useless keyword in the past reserved for expansion
2. Keyword expansion
安 increase of five keys
CONST :
Notice compiler, which can not be changed after Xiushifu after initialization of variables disposal.
Enum :
Enumeration enum types of claims at descriptions of the type used. Such as :
Enum = {male sex_t, femail}
Sex_t sex;
Sex = male;
Signed :
Allow the use of modified signed. Some compiler default is unsigned, the use of the ISO can.
Void :
Radio can be no return to the compiler can function declaration void; Guidelines for void* variable attributes can be claimed, in such circumstances, can use similar types wishing to use website at 47800.
Volatile :
Modified to prevent the compiler optimization variables. For example, a variable from the system clock is updated every 10 seconds. Statement volatile stop its compiler optimization :
Volatile int clck;
Int time1;
Time1 = clck;
If (time1==clck). . . ;
If not claimed in a statement volatile clck some compiler will optimize the value of the two expressions is clck only by the first inspection.
3. Transfer structure
C some early versions did not support the transmission structure in these versions, only traditional addresses such as pyramid arrays. 安, stack structure is completely passed into the function. If Chuan addresses can be used, operator &
4. Function prototype
安 proposed standard pre-defined functions allow itself to return to the type of variable types, which can function return values of variables and strong type checking. This is the prototype.
5. Standard Library
安 one of the most important features of the proposed standard definition of the C language compiler is the standard library functions to be set, thus enhancing the portability of c-language program.
6. Additional pre-processor directives
安 c of the standard Unix based on the increase :
#elif #line
#error #pragma
Acer also increased the number of internal 安 definition :
__LINE__ Current businesses
__FILE__ Million current document
__DATE__ Current system date
__TIME__ Current system time
If the standard is achieved __STDC__ home 1[/code] |
| |