Next part of the story.
So one more theoretical portion, the values which we lost, two functions are called arguments.
So here again, see on the previous slide.
See, here I have Indiana in B.
These are all arguments and arguments are of two types.
Let's see what is next.
So there are two types of arguments, actually, and for me, let's jump back good clean with our program
to see water actually arguments and what that formal arguments.
So if you look into our program here, I have just given my arguments like my first number is number
one and my first second number is number two, and I have botched this to that addition function.
So this is Carl and Boston that children use to the function.
So these arguments are actual are going so number one and number two, I can't actual arguments and
we have formal arguments also here.
Number one and number two are coming all here and it's now it's name is changed to Hannity right now.
One is store two.
Yeah.
And number two is still to be.
So now you can be archived formal arguments in the court for many arguments.
I think it makes sense to you why they have got it, because they saw the arguments which you are passing
to the function and these are the copy of that particular arguments.
No, another important topic, which we have s car by rally and car by reference.
So here we have three types of ways which we again face value to function.
One is by value.
Second is buys bad press and third is buys Bank of Finance.
So what is the difference between two, so supposing by sending out the value, then the copy of the
values passed with that function?
But if I'm basing the value we on convey that our friends make the list, we will check how it will
actually work.
So don't worry about that.
So if I'm posting evaluate their function, better friends or leader, I presume the function that value
spots to that function whenever there is a change in value in that function inside that function.
It is not reflected in that value because it's scarred by value.
But in this reference, all the changes made inside that function to that value will be reflected.
I would say the function then actual and formal arguments will be created in different memory location.
That is the main example of the car value.
And in case of car funds, actual and formal arguments will be rendered in same memory location, which
means they will be working on the same mediums.
So let's go to the next slide.
This I have already explained global and local variables.
So I have a variable in the program is not being say that function in that program.
That variable is global variable.
That variable can be accessed anywhere in the program.
But if it variable variables created or declared inserted functionally, then that variable is called
now variable, and that meaning will lie inside that function only after the function is ending.
That variable will we believe that that concept I have already explained you in that beginning.
So before moving on to Structure Park, let's move on to that covered by the forensics summary.
We have.
So here, let's take the first program car by value, this is that sadly be value, it's somebody here.
We have actual arguments and for formal arguments.
But what we're doing here, here we have number one and number two, but we are creating a copy of number
one and number two and giving it that into the final shape.
And that new copies resort called the.
So number one and number two, not equal to anything because both are different memory locations.
I'll be again in the Senate.
So if I'm trying to print the value off and be after the statement here right away and I just need to
make some adjustments to do this.
So here I am declaring the function, I'm right up to that function and I'm trying to see out.
A and B.
I'm saving this.
Let's see if this works.
OK, so first off, what I am comparing the program.
Plus comment.
There is an error because it is not defined or undeclared, identified because it cannot understand
because there is inside this function and be orally inside this function.
Why does the function is entered here than we used last?
So that's why we get our code and the order here.
It's not even compiling, it's throwing it out because it cannot recognize any.
If I am trying to come under the command and run this program again, then it will actually work fine.
Let's see that.
Yes.
Oh, I did.
And.
OK, function definition is not away.
OK, so we need to move down here.
OK.
So anyway, we will not be able to.
No, we will not get another.
Let's see.
No, it's executing this fine.
So anyway, here's what happened to there was number one and a different medium was only now more bad
news for $3 here.
And if I'm trying to change the value of this number one and I'm two, it will actually from here,
it will not work.
I don't like to change the value of I'm one and two from here because it's two different mediums and
no one is not saying if I'm making the value of it something and I'm trying to pull out number one,
it will not be saved because the end will not be fair.
So to understand this more properly, I will explain to you, call by reference.
So here again, see, our program goes back to values.
Ideally, we should have it covered by value program and also, yeah, here we have a car by value program.
So here I am, trying to stop doing how must have been.
I must know what I do and I'm trying to slap the number between.
So what?
No start ask.
No one should be number two and what the starting number one should be.
Number two.
OK, so then value and number two should be coming in, say no and no one should be coming in sick.
Number two, yeah, I'm actually using car by value method, so I'm asking for the first number.
Second number, then I'm calling this app function.
WhatsApp function do it will accept you now.
Must now want to do it, Williams said.
There are no number three and it will first dial one of the numbers inside three.
Then it will snap the other two numbers.
That is a strapping.
So what will actually happen?
See, we can run this program and see what that is the best thing to do.
So G Plus Plus card by value dark CBB.
Yes.
Then darts lashing out.
And that of us, no doubt.
And then the second number 15.
So inside and outside function before shopping, the value number one restaurant and number two was
15.
Inside function app after dropping the value when it get inside the function, it becomes 15 and 12
right by outside the function.
It can come back again.
I would say the function we are again printing number one and number two, what seat number one and
number two are saying?
Because the value which was here this morning and this number two are entirely different than new number
one or number two because like outside in the previous zombies, we are only sending that copy off number
one and number two.
And this is an entirely new number one item to restore the call piece.
OK.
And this gobies are actually changing out here by this number and this number, you are not changing.
That's why we are getting that same manual together.
So suppose we are sending the car by a reference method, sending the values through common reference
method, then we are not sending the values they are sending.
There are tests.
So let's see what happens there.
So we have got about our friends.
So, you know, so, yeah, statics and stowaway strap strapping or go static stories die.
So that is stark.
And here again, to see and see you again, see a sequel to 500.
And while may nice wrapping, then I'm sending our prospects and our debts off way to that final mission,
I have declared.
So what happens inside the function?
It will actually get done, get us off, extend right and start means the value inside that suffix straightaway
means the value in say that off right now.
What do we do after getting that value?
In that particular memory, we have a strapping next Saturday.
Values are exact locations in specific, not two different copies.
That means this X and Y, and this X and Y are sadly us like acting on it.
Same.
Variable, I know you have some kind of confusion.
So let's see this program in action.
So again, C++ scarred by Rough Dog CPB.
Now I'm going to head out out.
Radyo face is heartland and values raised by see he had expressed by Hendrick and why he was under.
So what happens if I'm printing it from here?
Here it's inside the function.
What happens if I'm printing?
See out?
Stop.
Star Trek's.
Star right now, I'm trying to.
Ricky, the program.
And I'm going to execute the program again.
So it's fine, but I'm fine.
Here again, I'll underline if I see that just because here the value changed and often even after exiting
from this foundation, the value is also changed because this X and this right was the same.
Variable, that's because you have that reference, not that you.