The order in which C language is executed in the computer can be divided into: 1. Editing; 2. Preprocessing; 3. Compilation; 4. Linking; 5. Execution.
[Recommended course:C Language Tutorial]
C language in Execution sequence in the computer:
Editing: The process of writing code through the keyboard is editing
Preprocessing: Include header files process (this function is only for the include instruction)
Compile: including compilation and assembly
Link: assemble The resulting file is converted into an executable file
The following article will introduce the specific content of each part to you
Edit
The process of editing refers to the process of writing programs and codes.
Preprocessing
Preprocessing is a process. In C language, preprocessing and Header files are used together
#include
The # mark in the above statement is a preprocessing instruction, and include is a specific instruction in the preprocessing instruction, which contains the preprocessing function of a source file. ade979de5fc0e1ca0540f360a64c230b is a header file that includes the file into the C language you want to write. This is a preprocessing directive. Of course, preprocessing is not just about files that contain this function, but also macro definition, conditional compilation, line control, diagnosis and other functions. This is specifically achieved through "#" "preprocessing instructions".
Compilation
Compilation includes assembly and compilation. Let’s look at the assembly process first.
The following diagram allows you to understand the process of forming assembly language from the source program:
The next step is the compilation process.
Compilation is the process of translating assembly language code into machine instruction code. The final result is the target file. The object file stores the machine language code of the source program.
Link
The target file must ultimately be linked to form an executable file before it can be executed.
Link means that a function in a source file may refer to a variable in another source file; then the link connects several related programs together, making all target files become one The entirety loaded and executed by the operating system.
The above is the detailed content of What is the execution order in C language?. For more information, please follow other related articles on the PHP Chinese website!