Compilation Process in C

The compilation is a process to generate object code from source code developed in C.

The phases through which our program passes are the following:

  1. Prepocessor: The input file with extension .c (for example “hello.c”) is passed to the preprocessor, and this converts the source code into expanded source code, which extension is .i, i.e the file output would be “hello.i.
  2. Compiler: The input file now is “hello.i”, and the compiler converts this expanded source code into assembly code, which output file would be “hello.s
  3. Assembler: Converts the assembly code into object code.
  4. Linker: Creates the executable file.