From

zhaozj2021-02-16  146

Word Source VC World - C language classroom

Self-archiving, also dedicated to the same Delphi programmer as me

C language development process

The C language is in the early 1970s. In 1978, the US Telephone Telegraph (AT & T) Bel laboratory officially published C language. At the same time, the famous "THE C Programming Language" book is combined by B.W.kernighan and D.M.ritchit. Usually referred to as "K & R", it is also known as "K & R" standard. However, there is no complete standard C language in "K & R", and later, a C language standard has been developed by the National Standard Society, published in 1983. Usually called ANSI C.

C language characteristics

C language is a structured language. It is clear, easy to organize programs in modularity, easy to debug and maintain. C language performance and handling ability. It not only has rich operators and data types, which makes it possible to achieve various complex data structures. It can also access the physical address of the memory and perform the operation of the bit (BIT) level. Since the C language implements the programming operation of the hardware, the C language integrates in the high-level language and low language functions. It can be used for the development of system software, and is also suitable for application software development. In addition, the C language also has the characteristics of high efficiency and strong portability. Therefore, it is widely transplanted to various types of computers, thereby forming a variety of C language.

C Source Procedure Structure Characteristics

#include "stdio.h" / * include called a file containing the command extension called .h file is also called header file or header * / # include "math.h" main () / * main is the function of the main function Name, indicating this is a master. Every C source program must have, and can only have a master function (main function). * / {double x, s; / * Define two real variables to use * / printf ("INPUT Number: / N") by the later program; / * Display prompt information * / scanf ("% lf", & x) ; / * Get a real number x * / s = sin (x); / * find the sinusoid of x, and assign it to the variable S * / Printf ("SINE OF% LF IS% LF / N", X, s); / * Display program operation result * /} / * main function end *

Include called a file contains commands, its meaning is to include the files specified in polar brackets "" or quotation marks <> to this program to become part of this program. The included file is usually provided by the system, its extension is .h. Therefore, it is also called a header file or header.

% LF is a format character, indicating that the dual precision floating point number is processed.

The annotation of the C language is a string that begins with "/ *" and ends with "* /".

There are two types of comma and spaces employed in C language. Comma is mainly used in type descriptions and function parameters tables, separating each variable. Spaces are used between the words of statements, interval. There must be more than one space between the keyword and the identifier.

1. A C language source program can consist of one or more source files.

2. Each source file can be composed of one or more functions.

3. One source program is composed of how many files, there is only one main function, ie the main function.

4. The source program can have a pre-processing command (the include command is only one), and the preprocessing commands should usually be placed at the forefront of the source file or source program.

5. Each statement must end with a semicolon. However, the pretreatment command, the function head and the larch "}" cannot be added.

6. The identifier, must add at least one space between the keywords to indicate interval. If there is an obvious interval, it can no longer add a spark.

转载请注明原文地址:https://www.9cbs.com/read-8690.html

New Post(0)