So now let's try to consider this example to understand more on the week to year, we will be predominantly
focusing on local and global variable and how to analyze them, you know, variable.
OK, so let's discuss diet, right?
So our hardware design just consists of a simple block design that we've been using from the beginning.
We have not modified, right?
So we have just done the modification, and this course says that you have certain functions been added.
OK, so we could test the global as well as local variable rate.
So we have one global variable, which we name as a global and initialized to one.
We have one function at 13.
So this will take over Cuba and it will simply add 13 to its value.
So here we have Tim, which is a local variable to act or did function.
Similarly, we have a square, but this will take a variable.
OK, and then will simply multiply it within globe right now here.
Square them is the local variable for this function, right when we consider the main function.
So mean also consist of four variable we have count.
I add 13 odd squares, so our 13 basically store the result, which is written by this function.
OK.
So this basically written an intent that is the temporally similarly odd squares to the result written
by this function.
Right now, first we are performing twenty five nutrition and we are updating the values of count day
and the result of this count we are feeding two at thirteen.
OK.
So this will basically add thirteen turistas and then it will be storing it in an audit.
And finally, this value we are reading over here, OK, which will basically multiply it with the global
variable.
And that is here.
And finally, we are printing, right?
So if we execute this, could we do able to see it as a test event?
Right now, we switch to a debug perspective so that we analyse an entire thing, right?
So first you try to add every right.
So we'll just be adding a breakpoint over here because we predominantly focus on local and global ready,
but we will not be any losing what happened in and far look OK because we we already know how far loop
is looking.
So let me just double click over here.
So here we have our breakpoint right now, ri right click on our debug folder never gets launched on
hard right.
So this will ask whether you want to relaunch or debug session, as well as whether we want to switch
to or debug perspective.
So we'll just click OK, OK, now this will.
Take us right to if you just take the call, it will take us to the point where we have added a breakpoint,
right?
So here we have a beat by.
And to this point you will see various variables which are local two and mean function, right?
So we are inside the main function that is what we're executing.
So all the variables which are local to a main function could be analyzed over here.
And then variable view to you have a count, which is first local variable.
Then we have an eye on address 13 and square.
OK.
And the point where we have added a big point to this point, we have the values for them as this rate.
So since far look is entirely executed to count whether it is three.
OK.
And I count should be twenty five.
Right.
So this represent iterations and added in our square should be initialized to zero.
And whenever we see an update that is highlighted with any look on the right.
So we would see all the local variables are being updated at hand to all of them are highlighted with
a local right now to go inside the function.
Now this basically suggests since we are local, we are inside the main function.
So all the local variables that we have an admin function are highlighted over here.
But the variable, which are local to add 13 as well as square, had not been mentioned in very rich
app that you could clearly see.
We do not have any TAM or rescue temple here, right?
So only the function in which we are.
All the local variable will be highlighted right now.
I pointed out I at 13 and here we have an eye 13 function, so let me just step inside this function.
So the first option that will help is going inside.
The function is stepping to make sure as soon as we had sipping do so, we are inside and at right vaccinés
we are inside and at 13, you could see now all the local variables are highlighted, right?
So you have an E who gave me to that argument that use every pass and say, given that we have this
tip, great now since we are here, so it is not initialized yet.
OK?
So you could see the evaluate that is the value of a count variable after four for loop accretion companies,
that is to be energy, OK, which has been updated and temp is yet to initialize so you can just click
on step and do OK.
So this will take us to the next statement.
So E value is now zero, and since it is updated so you could see it is marked within an aluminum right,
so you could argue one step and two.
So this will take us to the next concert and then finally will be coming out of our activity.
OK, so after we come out of an that you could now see?
As we move on to the next function, OK, so I just 13 is updated to three one three and that is highlighted
look right.
So from here, you could clearly see if we step in to a function.
OK, if you want to analyze the values of available which are local to certain function, then you need
to mandatorily step in to a function.
And then you could analyze the while right now, something interesting to observe over here is the only
difference between the previous function that is at 39 squares in an act that we haven't utilized a
global variable, right?
But here you could really see we are utilizing a global rating, right?
So if you just step inside the square function, let's see whether we will do an the global rating,
right?
So we will be utilizing step into.
OK.
So as we enter into the square function, you could see the variable which are local to square are been
reflected in any area would be right to be happy and square 10, which have been added in.
And they will be.
But we are not seeing a global edible over here, right?
So.
Whenever we.
I had a global variable inside the functions of the Ed Norton character, medically added into variable
rate, so to analyze them the simplest strategies you will select and a variable.
Right now we have selected it right click and then you have an option to add to watch expression.
So we'll just be adding an expression and then click, OK.
So here we just need to specify the name of the variable.
Click OK.
And then you could see that we have one more tab, which is either that is expression.
OK, so the breakpoint highlight the specific position where we have had it every point.
Variable indicator variables which are local to the specific function where we are in an expression
is used to analyze the user defined expression.
OK, so this may include the global variable right here.
So global is not been included even when we are inside the square right now, if we just try to execute
by utilizing step into.
OK, so now.
You could see the values of labor, so if you just updated the values of labor, you could actually
reflect the changes you were here.
Right?
So this is the strategy.
Then you want to analyze a user defined expression or a global view, but you need to take the help
off and watch expression, right?