The Steps of Compilation in the C Programming Language

John Hoang Dinh
2 min readJan 18, 2018

Hello world! I’m going to teach you the steps of compilation in the C programming language.

Any C program that we write must first have source code (a .c file). The components of the compiler are the preprocessor, compiler, assembler, and the linker. The c program source code (.c file), must first be preprocessed by the preprocessor. From there the preprocessor will generate a file so that the compiler may use it to translate it into assembly code. The compiler role of the compiler is to convert files generated by the preprocessor as an input and generate it into assembly code. Essentially, it converts our c program files into assembly language. Since computers can only compute binary code, the assembler must now translate the assembly code into machine readable code. The assembler will then convert the assembly code into object code. From here, the role of the linker is to link our library code (functions from our library) and object code together. After all of this is done, it becomes an executable file.

In summary, the first step in the compilation process is the pre-processing. The second step in our compilation process is the compilation. The third step in the compilation process is our assembly. And the fourth step in the compilation process would be the linking. These are the steps of compilation in the C programming language.

--

--