C Program to the .exe file
As we know a computer is an electronic machine which can understand only machine language
which is Binary language(In the form of 0's and 1's).But Binary language is
Operating System dependent that means it may defer OS to OS. So we need a
language that is the same for all systems.C is that language.
When we write C program, we save it with .c extension file. it is a necessity to convert it into machine
code, which contains the .exe extension. This is a slightly longer process to
convert machine code into binary code. We can easily understand this process through
the diagram.
(given below)
Block diagram of c program to .executable file |
It this process when we submit the c program to the compilation first a preprocessor software runs, it replaces all preprocessor directives with some lines of code(the statements which start with # symbol called preprocessor directives). It also includes all codes of header files which we wrote in the c program and it generates a new file with the extension of .i. After that compiler compiles this file and converts it machine understandable code on the basis of OS. This file contains .obj extension. This file not fully understandable by the machine. Now Another software runs which is Linker.it includes some header files in the code and converts this code into an executable program.this file contains .exe extension.
You can also visit:-