C Language Learning (1), C Language Learning (
C language is the most popular and widely used high-level programming language in the world.
C language is better than other advanced languages for operating systems and system programs and hardware operations. Many large applications are written in C language.
The C language has strong plotting ability, portability, and strong data processing capabilities. Therefore, it is suitable for compiling system software, 3D, 2D graphics, and animation. It is a high-level language for numerical computing.
I. C Language Development History
C language development is quite interesting. Its prototype is ALGOL 60 language. (Also known as language)
In 1963, the University of Cambridge developed the ALGOL 60 Language into the CPL (Combined Programming Language) Language.
In 1967, Matin Richard of the University of Cambridge simplified the CPL language and produced the BCPL language.
In 1970, Ken Thompson of Bell Labs modified BCPL and gave it an interesting name "B Language ". It means to cook CPL language and extract its essence. He wrote the first UNIX operating system in Language B.
In 1973, language B also gave us a "boil", D. m. RITCHIE finally designs a new language based on the B language. He takes the second letter of BGPL as the name of the language, which is the C language.
To facilitate the promotion of UNIX operating systems, Dennis M. Ritchie published the C language compilation text "portable C language compilation program", which does not depend on the specific machine system in 1977.
In 1978, Brian W. Kernighian and Dennis M. Ritchie published The famous book "The C Programming Language", making C Language The most popular advanced Programming Language in The world.
In 1988, with the increasing popularity of micro-computers, many C language versions emerged. Because there is no unified standard, there are some inconsistencies between these C languages. To change this situation, the American National Institute of Standards (ANSI) has developed an ANSI standard for the C language and has become the current C language standard.
Ii. Features of C Language
C language has developed rapidly and has become one of the most popular languages, mainly because it has powerful functions. Many well-known system software, such as DBASE Ⅲ PLUS and dbase iv, are written in C language. Using C language with some assembly language subroutines can better show the advantages of C language, such as PC-DOS, WORDSTAR, is written in this way.
1. Simple, compact, flexible, and convenient
The C language has a total of 32 keywords, 9 control statements, and the program is free to write, mainly expressed in lower case letters. It combines the basic structure and statements of advanced languages with the practicability of low-level languages. The C language can operate on pairs, bytes, and addresses like the assembly language. These three are the most basic work units of the computer and it is easier to continue learning. We recommend that you do not find shortcuts, except for passing the exam.
2. Rich Operators
The C operator has a wide range of 34 operators. The C language treats parentheses, assignments, and forced type conversion as operators. Thus, C's operation types are extremely rich and diverse expression types, and various operators can be flexibly used to achieve computation that is difficult to implement in other advanced languages.
3. Rich Data Structures
The Data Types of C include integer, real, String, array, pointer, struct, and shared body. It can be used to perform operations on various complex data types. The pointer concept is introduced to improve program efficiency. In addition, the C language has powerful graphics Functions and supports a variety of displays and drives. The computing and logic judgment functions are powerful.
4. C is a structured language
The distinctive feature of structured language is the separation of code and data, that is, each part of the program is independent of each other except the necessary information exchange. This structured method makes the program layers clear and easy to use, maintain, and debug. The C language is provided to users in the form of functions. These functions can be conveniently called and have multiple loops and conditional statements to control the program flow, so that the program is fully structured.
5. C syntax constraints are not strict, and the degree of freedom in programming is large.
Generally, the syntax check for advanced languages is strict, and almost all syntax errors can be checked. C allows programmers to have greater degrees of freedom.
6. The C language allows direct access to the physical address and can directly operate on the hardware.
Therefore, it has both advanced language functions and many low-level language functions. It can operate on the same position, byte, and address as the assembly language, and these three are the most basic work units of the computer, it can be used to write system software.
7. High quality of C language code generation and high efficiency of Program Execution
Generally, the efficiency is 10-20% lower than the target code generated by the assembler.
8. The C language is suitable for a wide range of applications and has good portability.
C language has a prominent advantage that it is suitable for a variety of operating systems, such as DOS and UNIX, and also for a variety of models.
Of course, C language also has its own shortcomings. For example, the syntax restrictions of C language are not strict, the type constraints on variables are not strict, the program security is affected, and the subscript of the logarithm family is not checked out of the border. From the application perspective, the C language is more difficult to grasp than other advanced languages.
In short, C language has both the characteristics of advanced languages and assembly languages. It is a successful system design language and sometimes a programming language; it can be used to write applications that do not rely on computer hardware, but also to write various system programs. It is a popular and widely used programming language.
3. 7 steps of using C language
1. Define the program goals
2. Design Procedures
3. write code
4. Compile
5. Run the program
6. Test and debug the program
7. Maintain and modify Codes