Now, next topic is command line arguments in C++.
So in case of common main arguments, we will be actually using the concept for suppose I have a program
and in the start of the program, it said it without even running the program.
I want to supply some variables or arguments to that program from my testimony.
OK.
From my command, from the from from my bash, whatever operating system we are using from that terminal.
If I want to supply some variables to C++ program, then it's very easy to use command line arguments.
So we will be using command line while we are writing the main function of the program.
So there are two command line arguments in ARGs.
C and Java Star R V and at C will count how many things you are passing while you are running the program.
And are we use actually the number of arguments which you can get with the program?
You can give any number of program arguments if that program is accepting that number of arguments so
axes use for it's an integer variable and store the number of command line arguments possibly that you
set, including the name of the program.
It's actually it will count from the name of the program, so name of the program is one argument.
So if you pass one value to a program, that value vaccine will be two.
Because one is argument, which we have based and run this for program, meet the value of our C should
be nor negative.
Then are we sorry?
Updated this one listing all the arguments.
So if Odyssey is greater than zero, that it is wrong, I agree.
23 00:00 See my half agree c minus one will convert blind us to string are we of zero will be the name
of the program.
After that, they are.
We are C minus one will be our elements.
What all elements we pass will be coming after that.
So why do we need to pass something to a program before it's getting executed?
It's because sometimes we need to execute a program by without without any havoc, like without going
inside the program.
We want to execute that program with some defined values, right?
So in that case, we would be using a command line carbons.
So it's kind of our for it.
So if it's better to understand, do that like before you execute that program while you are just running
that program, you will be able to supply some values into that program.
And for that, you have to use this for syntax indexing in your main function.
And that main function is holding two arguments.
One is I see that's a simple argument which will show you how many number of hours when you are passing
into the program and Gustav, oddly victor, it's actually an error which will show what are the things
you passed into that program that all things will be stored as an array in sight?
Are we OK now?
Nothing more to discuss.
Let's go to that demo of this one and see how this is working.
So I had a five part command line or CPB.
Here I have the C defined out here and got to start stop RV also to find out here.
So how you can do this without even entering the the program?
I'm trying to compile it first.
C++, cmb line dark CBB right now while I'm executing Dodge Slash.
Usually we use it outright, but instead of here dart out, I'm planning to give some other values.
OK, so I'm gaming main.
Then I'm planning to use some values inside.
Arguably, I suppose one values one and so it should be different values.
You can pass it your back to League One by using it space.
So one variable will be main, then another variable may be one I space another maybe would be DC.
Another way may be happy on that score line.
So you again see how many variables I'm getting actually giving in to the program without even going
into the program.
One two three four.
No, I need output.
It should be fired, right?
How many I believe will be in dirt that will be fired, why it should be fired.
It's because one before I have passing and one is actually the programming.
Now I am going to execute C like that is a small Z index setup.
Before that D plus plus I have to improve my mode parameter Typekit all then I.
The main function, because it's like main function will be that starting.
OK, now I need to do that second statement.
Now you showing how many arguments I have endured into the program.
It's one two three four.
It's like you have ended four arguments.
It will be the value of moxie, right?
They're printing oxygen here.
And one by one, we are printing out of the army first.
Outgoing Dodge flash me second argument.
One third argument.
ABC bought argument.
Happy.
OK, this is all about command line arguments in C++.