Basic composition of the c language
Language c is a universal computer programming language and is widely used. The design goal for the c language is to provide a programming language that can be compiled, processed low-level storage, produced small machine codes and operated without any operational environment support. Here's the basic composition of the c language collected by the editor. I hope you like it
Data type
Data types for c include integers, character types, solid or floating-point types (single and double-precision), array type, array type, structural body type, common body type, pointer type and empty type。
Constants and variables
The constant is immutable and the symbol constant is usually in capital。
The variable is named by an identifier whose value can be changed. The identifier is a series consisting of letters, numbers or underlined sequences beginning with letters or underlineds, noting that the first character must be alphanumeric or underlined, otherwise the name of an invalid variable. Variables are assigned corresponding storage units to them when they are compiled。
Array
If a variable is followed by a numbered parenthesis, the statement is an array statement. Strings are also an array. They end with ascii null. In particular, index values within square brackets are counted from zero。
Pointer
If a variable states that it is a pointer-type variable using the * sign in front. In other words, the variable stores an address and * (here refers to a single-line operator *, down. There is another binary operator* in the c language that takes the content operator, meaning the contents stored in this memory address. The pointer is one of the main features of the c language that distinguishes it from other simultaneous high-level languages。
The pointer can be not only the address of the variable, but also the address of arrays, array elements, functions. You can obtain more than one return value in the call process of a function by using the pointer as a form parameter, as opposed to only one return value such as return(z)。
The pointer is a double-edged sword, many of which can be expressed naturally by the pointer, but the incorrect or excessive use of the pointer can lead to numerous potential errors in the procedure。
String
The string in the c language is actually based on♪ i'm sorry ♪The char-type array at the end of the 'char ' character does not require a reference library, but the use of the string requires some of the functions in the c standard library used to operate on the string. They are different from character arrays. Use these functions to refer to the header file。
File input/output
In the c language, the input and output is achieved by a set of functions in the standard library. In ansi c, these functions are defined as headers; in。
Standard input/output
Three standard inputs/outputs are predefined in s/o library:
Standard input for stdin
Stdout standard output
Stderr input output error
Operations
The calculation of the c language is very flexible and functional, with far more types of operation than other programme design languages. In terms of expressions, they are simpler than other programme languages, such as self-adding, self-declining, commas and triangulations, which make the expression simpler, but are often difficult to read by beginners, the key reason being the incomplete understanding of operators and the sequence of calculations. The priority of the operation and the rules of integration are important when many different operations form an operation expression, that is, multiple operators appear in one operation。
Outreach:
Introduction
The c language is a process-oriented computer programming language, different from the c++, c# and java object-oriented programming languages. The c language is designed to provide a programming language that can be easily compiled, processed low-level storage, produced only a small number of machine codes and operated without any operational support. The question of the description of the c language is more rapid than the language of the compilation, with a small workload, readability, ease of debugging, modification and transplantation, and the quality of the code corresponds to the language of the compilation. The c language is generally only 10-20 per cent less efficient than the target program generated by the compilation language code. As a result, the c language can produce software for the system。
At the current stage, in the programming area, the use of the c language is very high, taking into account the advantages of advanced and compiling languages, which have a greater advantage than other programming languages. Computer system design and application preparation are two major areas of application in the c language. At the same time, the c language is more universal and can be applied and efficient in many computer operating systems。
The c language has a complete theoretical system that has a long history of development and has a significant place in programming languages。
Main features
Language c is a structured language with a clear hierarchy that allows the program to be prepared in a modular manner, which greatly facilitates the debugging of the program, and the processing and presentation capacity of the language c is very strong, relying on very comprehensive operators and diverse data types, which can easily complete the construction of various data structures and, through the type of pointer, allow for direct reference to memory and direct operation of hardware, and can therefore be used to develop both system programs and applications. The main features of the analysis of the c language are as follows:
(1) simple language
There are only nine control statements and 32 keywords contained in the c language, and many unnecessary parts have been streamlined with less stringent and lowercase writing requirements. In practice, statements constitute less hardware-related features and the c language itself does not provide hardware-related input-output, document management, etc. If required, they need to be programmed in conjunction with the various libraries supported by the compilation system, so that the c language has a very simple translation system。
(2) structured control statements
The c language is a structured language, and the control statements provided have structural features, such as forewords, if... Else and switch. It can be used to achieve logical control of functions and facilitate process-oriented program design。
(3) types of rich data
The c language contains a wide range of data types, including not only traditional character types, integers, floats, array types, but also data types that are not available in other programming languages, with the most flexible use of indicator type data, which can be calculated through programming。
(4) rich operators
The c language contains 34 operators, which treats values, brackets, etc. As operators and enriches the expression type of the c program and the type of operator。
(5) direct operation of physical address
The c language allows the hardware memory address to be read and written directly, thus fulfilling the main functions of the compiling language and operating the hardware directly. Not only do c languages possess the good qualities of advanced languages, but they also include the advantages of many lower-level languages and therefore have extensive applications in the area of software programming。
(6) better portability of codes
The fact that language c is a process-oriented programming language and that users need only focus on the problem itself and do not need to devote too much effort to understanding the hardware in question, and that, for different hardware environments, the code is basically consistent when performing the same function in the same language c, and a transplant can be completed without a small amount of change, means that a c program prepared for one computer can operate easily on another computer, thus significantly reducing the intensity of the process transplant。
(7) generate high quality, target code efficient programs
Compared to other advanced languages, c languages generate high-quality and efficient target codes and are usually applied to the preparation of embedded system procedures that require higher standards of code quality and efficiency of implementation。




