welcome back to the series of introduction to computer programming in this video we will discuss about the steps involved for writing a c++ program to generate a executable file
which is then executed on a machine to generate an output the code written in any programming language is known as the source code
The source code of c++ is having extension of .cpp it is most commonly used along with the .ccp file there is another type of file which is used for writing the c source code that is known as the header file the header files which are dot h contains the declaration of features and the file with the .cpp will actually contains the implementation in c plus you can create your own header files and include it in libraries but we will discuss that later on
now coming to the process of creating a executable file from source code it is called build process let's look at the build process there are certain steps for build process step one pre-processing the pre-processing is basically a macro processing program it takes the C++ source code and performs some processing on it and generate an intermediate code the preprocessor will include the content of the header file in our source code the new file which is generated by the preprocessor having extension of .ii intermediate code can not be executed in second step the compilers come the compiler is a computer program that translates a high level programming language to machine code but some steps are involved in between compiler will take the intermediate code and generate a assembly the compiler will check all the set of rules and syntax in your code if the rules are not followed the compiler will generate errors now you have to go back to your source code to correct it and you have to do the building process once again in step number three we will use assembler
The assembler generates the machine code or we can say object code the extension of
this file is .obj we have a machine code but we cannot execute this file in the next step which is step number four we need to link object file and associated file to a single executable file for that purpose we have a program known as linker the linker takes the
object and associated files and links them with the library file to generate an executable file we will discuss about the library files in some other video
Now the build process is completed the next step is to execute the executable file for that use a program known as loader the loader will load the executable file into the ram so that it can run by a cpu after the execution we will get our result we will be using Dev c++ in this lecture series all the steps will be performed by the IDE we only have to write the
source code in c++ rest will be performed by Dev c++.