All right.
So now let's create a CBP file and let's
see how to run it inside your vehicle.
So let me just quickly add my header file.
So hash included.
And by the way, if you don't know how I get all of these boilerplate
by just writing in hash, include, then you can watch my snippets lecture.
I have shown you how to do it there. Right.
So now let's write down the first basic program that is out and Hello World.
And after that, let me just simply write, just run it.
So in order to run it, there are a couple of ways available.
And the first one that I can do is I can simply click on this
run code option, and this will simply run
the score inside my output terminal so you can see hello earlier
or as I can just simply right click or use this option.
Also, there is a shortcut that is all troll rn to run it.
And by the way, this feature is available because of the Cold Runner.
Right?
So we have also installed a C++ compiling run extension
and due to some reason, suppose the cold runner extension is throwing some error.
Then you can use this.
There's a hard key to compile and when your program and in windows
this is f6 so this may not sleep fine
if I just simply place f6
and then this will show me the same output you can see here.
So this is how to run a simple program.
Now let me do the input driven program here.
So basically we will be taking an input and from the user
and we will be displaying numbers from one to N.
So let me write a loop here and,
and before
running this input driven program from our code
and I know we need to go to our settings and we need to make sure
that we allow the cold runner to run in terminal.
So you need to search our code right now and you need to scroll down until you find
code runner and in terminal option and make sure this is checked.
And after that, just simply close this terminal
and again, this click it to run this program.
Now let me give the input of menu and press enter
so you can see I got all the numbers from one to then.
Similarly, I can simply press f6
and I will get the same output, but this time from compiling one.
So let me give a number ten and I will get the same output.
So this is how to basically compiler and programs.
Also, if you want to stick with the fundamentals,
then you can also use the DART sign
and then a backward slash and the name of your zip file.
In this case, the name is Main.
So after that, if you press enter, then basically this will do the same thing.
So this will run your same program.
So these are the three ways to run a C++ file
and the third one while running the third one,
make sure you are on a CMB
terminal inside your voice code.
So this is one of the reasons why I have told you to make sure
you have set your default terminal as CMD
inside a Windows machine for Mac.
There's no issue you can go with Bash
or LSH, whatever you want. Right?
So this is it for this lecture
and the next lecture I will give you a good template
for using all for writing C++ called Inside of Code Added.
All right, so see you in the next one.