The C Programming Language Preface

    In 1988, the American National Standards Institute (ANSI) specified a precise standard for the C language (ie ANSI C). The standard maintains the expressiveness, efficiency, small scale, and ultimate control of the machine of C, while also maintaining the portability of programs that conform to the standard. ANSI C specifies structure assignments , enumerations , and a new way of declaring and defining functions compared to the previous versions . The new way of declaration and definition of functions allows cross-checking of function definitions during use. At the same time, ANSI C defines a standard library for the C language. The standard library describes the behavior of certain features that are not clear in the C language itself , and also clarifies some features in the C language that are related to specific machines.

    Appendix A is a reference manual that provides an overview of the ANSI C standard and is intended to help programmers better understand the language itself (which itself does not serve as a standard). Appendix B is a summary of the functions provided by the standard library. Appendix C is a summary of the changes made to the ANSI C standard from versions between.

    C language is a general-purpose programming language. It has a very close relationship with UNIX - the C language was developed on the UNIX system, or the C language was created to rewrite UNIX. Because C language is very suitable for writing compilers and operating systems , it is called "system programming language".

The basic types     provided by the C language include characters, integers, and floating-point types, as well as non-primitive types pointers, arrays, structures, and unions. Moreover, derivation operations can be performed between these types.

    Expressions are composed of operators and operands. Any expression can be a statement. Pointers provide machine-independent address arithmetic.

    Terminates the loop that tests at the top (while, for), and terminates the loop that tests the bottom (do).

    Functions can return values ​​of primitive, struct, union, or pointer types (excluding arrays). Any function can be called recursively.

    Function definitions may not be nested, but variables may be declared in a block structure.

    Different functions of a C program can appear in different source files compiled separately. Variables can be valid only inside a function, outside a function but only in one source file, or across the entire program.

The preprocessing phase of     compilation will perform macro substitutions on program text , include additional source files , and perform conditional compilation .

    The C language itself does not provide direct manipulation of complex objects such as strings, sets, lists, or arrays. Apart from the static definitions and stacks provided by the local variables of functions, the C language itself does not define any memory allocation facilities , nor does it provide heaps and useless memory reclamation facilities .

    The C language itself only provides a simple single- threaded control flow. The multi-thread control of C language is realized by calling library functions or system calls of the operating system

    The most important change in ANSI C from previous versions is the new syntax for function declarations and definitions. Function declarations can now contain information describing the actual parameters of the function; accordingly, the syntax of definitions has changed. This feature makes it easy for the compiler to detect errors caused by parameter mismatches .

    The ANSI C standard library is very similar to the "standard I/O library" for UNIX systems. In fact, the implementation of the ANSI C standard library is closely related to the specific operating system.

Since most computers directly support the data types and control structures provided by the C language, self-contained programs can be implemented with     only a small runtime library .

    The ANSI standard explicitly addresses portability and presupposes a set of constants that describe the characteristics of the machine on which the program is run.

    The type checking mechanism of ANSI C has been enhanced. The ANSI C standard requires proper declaration of variables and explicit casts (for conversions between incompatible data types, except for type promotions).

    The standard library provides a common interface for interacting with the operating system. The library is defined by ANSI, which means that all machines that support C will support it. Thus, programs that use the library to perform input, output, or other operations that access the operating system can run on different machines without modification.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325992067&siteId=291194637
Recommended