Hey welcome I hope you'll remember this program.
I already have executed this program while downloading and installing various IDs in the previous section.
If you missed that just go ahead and run this once more.
The purpose of this program is pretty simple.
It's going to print hello world into the console.
OK so here we go.
I'll just run this once more.
Click on build canals.
Click on it then run.
If you are using X code on math Carvey's will suit you.
And please few the appropriate tutorial in the previous section to get the idea how to run programs
within those environments.
So I'll use code loss in this tutorial.
So here we go.
We can build and run.
And here's the output.
You say that hello world is printed on the console.
So that's the purpose of this program.
Pretty simple but you need to understand this program clearly in order to go ahead and start learning
C++ because everything starts with this program.
Before I go ahead and explain everything of this program I'd like to ask you a question.
Do you know who or what practical executes our program on the machine.
It's the operating system Windows Linux on Mac.
Now the operating system is the manager not the hardware it manages the hardware.
We just don't interact with the hardware when we create our program in order to execute the program
the program will need memory to lead processor.
It will need audio devices so all these hardware components are going to be required by the problem
for proper execution.
Now these hardware resources are managed by the operating system with only to interact with the hardware
directly.
So is the operating system that to care for the execution of our program.
We just need to submit our program to the operating system and the rest of the responsibility for execution
of the problem lies on the shoulder of the operating system.
So Gerty's we have hardware right past the hardware component hardware layer in our machine but that
is abstracted either operating system or s like Windows or Linux or Mac.
So we always interact with the operating system and this operating system executes our program.
But the problem is that none of the operating systems are actually recognizes any of the programming
languages.
So what happens if we submit the C++ program directly to the operating system as it is right now here.
The operating system is going to recognize this as a text file and it's not going to recognize this
as a program so it's not needed to get this one.
So what you need to do is to translate this program that you have written in C++ to operating system
understandable format.
And here comes that is far less of compiler.
The purpose of the compiler is to translate the source code that we have written in some language some
high level language like C++ or C to the operating system understandable format.
It happens in this way.
We will actually submit our source code that is maned RCP here do the C++ compiler C compiler.
Because our language is C++ and the C++ compiler.
Thus it produces a translated file that is operating system understandable format that atypically car
object file that contains object code.
So the output of this compiler is going to be main dot all as the object file that is going to be created
by the compiler.
Obviously compiler needs the source code error free.
That means he should not have any kind of syntax error in the source code.
You should get semi-colons properly or the braces properly or a MUST use the keywords appropriately.
In that case only the compiler is going to compile your source code.
Otherwise if the compiler finds anything that error in the source file is going to generate it at least
with the line number and brief description and you'd require to rectify all those errors and correct
them before it could submit your file for recompilation.
So once that compilation is done successfully this object file is going to be created.
Now what happens in real life in a single program.
It may have several files in a single software or application.
You may have several source files you may have named or CPV as one file.
You may have funded CBT and either one because we are going to modernize our program we'll have different
model written in different files and ima have another one set called R.S.V.P..
So all these are part of the same program.
OK so now what happens when you want to actually build the executable you need to compile all these
files in it.
All these files to the compiler and compiler is going to try to use object code for each of these files.
So far maned actually Pippy it to create main guggle for fundit say BP is going to create fund all and
for all that CPB is going to create all involved.
So all these object files will be there.
Now what you need is a single executable that we need to bundle together all the object files in a single
executable file.
And for that there is build mutuality.
So we will actually invoke the believe to duty after that and this build if that is going to combine
all these things all banded together.
All these things into a single executable unit.
Now you might use some library functions in your program Aspel the library utilities contains many utility
functions in C++ or in Java or in C..
You are having a rich set of libraries where many functionalities classes types are already involved
so that you can get that job and quickly so you can use some of the library utilities in your program
to do the job.
So if you have done so then that builder is going to inject that library utilities with the executable
as well because when the program is going to be executed at the library utility has to be there within
the executable so it injects all those things in a single executable it and produces that you see for
Windows.
So if your product name is first a b like this one then that executable is going to be first KPP that
actually for Windows platform.
If you are using Linux or Mac is going to be first Peepy got how to ask the executable for Linux on
a Mac platform.
So now if you take this you see to any Windows system and it's going to run them.
If you take this first Abdur out to any Linux system it's going to run.
So that's how this executable is created.
Now when you are using IDS like this one is called Lost and what happens when you are clicking this
failed and run here all these things are happening behind the screen.
Please remember one more thing that this ID is not a compiler compiler is a separate entity and this
ID is only a smart editor.
OK.
So when you are clicking on that build and run it's actually invoking the compiler first.
That's going to happen with all files the object files and then it's going to be it's going to call
the builder.
That's going to build that EFC.
So that is happening.
All those things are happening behind the screen.
I'll show you that.
Let me just show you that.
OK.
I'll go to the folder.
Here is the project folder first AP that I have saved here in this spot.
And if I go inside this process folder you can see that this maned R.S.V.P. is our source file.
And we didn't deposit folder we have two folders there.
One is this all Widger and of that is this been.
If I go inside this showbizzy I'll find another folder.
That's a bag.
And inside of this debug folder you can see that object file is there.
So this OPG slash D-bag is the home for the object files.
Now let me show you the other one.
This bin folder.
Now if I go inside this pin I'll find another D-bag.
And inside this D-bag you can see that the executable is there.
So this Bindy bag is the home for the executable.
When we click on this field and it can run the compiler compiles this program Missippi be fine.
And it actually produces the old file inside that or we check it back and then the build comes into
play.
And that is the single executable by finding all those Optik files.
So I'll show you that on the fly.
Let me just delete all these things.
OK I'll delete that object file as well and I'll open two views of the same folders.
OK the bottom one is that bin debug and the top one is that or which at the back.
Now I'll just hit that build and build and run and you'll see that of that fight.
Those files are created there.
Here it is.
You can see that the first after the X is created here.
And the main door is created there on the object the back.
So that's how all the things happens behind the screen.
I hope you have enjoyed this.
I'll just not make it more lengthy in the next tutorial.
I'm going to explain this first problem to you.
OK so I'll explain why this is Main.
What's the meaning of that and why but what's the purpose of this hashing include ice cream.
What's the purpose of this let's understand the C out.
I'll explain everything in the next tutorial.
So stay tuned.