1
00:00:00,060 --> 00:00:06,240
So now let's try to consider this example to understand more on the week to year, we will be predominantly

2
00:00:06,240 --> 00:00:13,020
focusing on local and global variable and how to analyze them, you know, variable.

3
00:00:13,650 --> 00:00:16,820
OK, so let's discuss diet, right?

4
00:00:16,830 --> 00:00:23,150
So our hardware design just consists of a simple block design that we've been using from the beginning.

5
00:00:23,160 --> 00:00:24,910
We have not modified, right?

6
00:00:24,930 --> 00:00:30,390
So we have just done the modification, and this course says that you have certain functions been added.

7
00:00:30,450 --> 00:00:34,410
OK, so we could test the global as well as local variable rate.

8
00:00:34,410 --> 00:00:38,640
So we have one global variable, which we name as a global and initialized to one.

9
00:00:39,450 --> 00:00:41,930
We have one function at 13.

10
00:00:41,940 --> 00:00:46,530
So this will take over Cuba and it will simply add 13 to its value.

11
00:00:46,850 --> 00:00:51,270
So here we have Tim, which is a local variable to act or did function.

12
00:00:51,270 --> 00:00:54,480
Similarly, we have a square, but this will take a variable.

13
00:00:54,570 --> 00:00:59,190
OK, and then will simply multiply it within globe right now here.

14
00:00:59,220 --> 00:01:04,020
Square them is the local variable for this function, right when we consider the main function.

15
00:01:04,620 --> 00:01:08,090
So mean also consist of four variable we have count.

16
00:01:08,190 --> 00:01:15,720
I add 13 odd squares, so our 13 basically store the result, which is written by this function.

17
00:01:15,810 --> 00:01:16,170
OK.

18
00:01:16,620 --> 00:01:23,220
So this basically written an intent that is the temporally similarly odd squares to the result written

19
00:01:23,220 --> 00:01:24,030
by this function.

20
00:01:24,260 --> 00:01:29,910
Right now, first we are performing twenty five nutrition and we are updating the values of count day

21
00:01:29,910 --> 00:01:34,110
and the result of this count we are feeding two at thirteen.

22
00:01:34,650 --> 00:01:35,010
OK.

23
00:01:35,130 --> 00:01:40,950
So this will basically add thirteen turistas and then it will be storing it in an audit.

24
00:01:41,190 --> 00:01:46,590
And finally, this value we are reading over here, OK, which will basically multiply it with the global

25
00:01:46,590 --> 00:01:46,980
variable.

26
00:01:46,980 --> 00:01:48,210
And that is here.

27
00:01:48,240 --> 00:01:49,830
And finally, we are printing, right?

28
00:01:49,860 --> 00:01:54,360
So if we execute this, could we do able to see it as a test event?

29
00:01:54,570 --> 00:02:00,720
Right now, we switch to a debug perspective so that we analyse an entire thing, right?

30
00:02:00,720 --> 00:02:03,900
So first you try to add every right.

31
00:02:03,900 --> 00:02:11,970
So we'll just be adding a breakpoint over here because we predominantly focus on local and global ready,

32
00:02:11,970 --> 00:02:19,050
but we will not be any losing what happened in and far look OK because we we already know how far loop

33
00:02:19,050 --> 00:02:19,500
is looking.

34
00:02:19,740 --> 00:02:21,330
So let me just double click over here.

35
00:02:21,690 --> 00:02:29,840
So here we have our breakpoint right now, ri right click on our debug folder never gets launched on

36
00:02:29,970 --> 00:02:30,620
hard right.

37
00:02:30,630 --> 00:02:35,850
So this will ask whether you want to relaunch or debug session, as well as whether we want to switch

38
00:02:35,850 --> 00:02:37,200
to or debug perspective.

39
00:02:37,200 --> 00:02:40,650
So we'll just click OK, OK, now this will.

40
00:02:41,570 --> 00:02:49,370
Take us right to if you just take the call, it will take us to the point where we have added a breakpoint,

41
00:02:49,370 --> 00:02:49,550
right?

42
00:02:49,600 --> 00:02:51,170
So here we have a beat by.

43
00:02:51,590 --> 00:02:58,310
And to this point you will see various variables which are local two and mean function, right?

44
00:02:58,640 --> 00:03:01,610
So we are inside the main function that is what we're executing.

45
00:03:01,610 --> 00:03:06,260
So all the variables which are local to a main function could be analyzed over here.

46
00:03:06,470 --> 00:03:11,000
And then variable view to you have a count, which is first local variable.

47
00:03:11,300 --> 00:03:15,530
Then we have an eye on address 13 and square.

48
00:03:15,590 --> 00:03:15,870
OK.

49
00:03:15,890 --> 00:03:23,450
And the point where we have added a big point to this point, we have the values for them as this rate.

50
00:03:23,450 --> 00:03:27,890
So since far look is entirely executed to count whether it is three.

51
00:03:28,760 --> 00:03:29,100
OK.

52
00:03:29,330 --> 00:03:31,040
And I count should be twenty five.

53
00:03:31,070 --> 00:03:31,260
Right.

54
00:03:31,280 --> 00:03:36,560
So this represent iterations and added in our square should be initialized to zero.

55
00:03:36,560 --> 00:03:40,850
And whenever we see an update that is highlighted with any look on the right.

56
00:03:40,850 --> 00:03:46,420
So we would see all the local variables are being updated at hand to all of them are highlighted with

57
00:03:46,790 --> 00:03:51,290
a local right now to go inside the function.

58
00:03:51,320 --> 00:03:55,160
Now this basically suggests since we are local, we are inside the main function.

59
00:03:55,160 --> 00:04:00,020
So all the local variables that we have an admin function are highlighted over here.

60
00:04:00,230 --> 00:04:06,860
But the variable, which are local to add 13 as well as square, had not been mentioned in very rich

61
00:04:06,860 --> 00:04:08,060
app that you could clearly see.

62
00:04:08,060 --> 00:04:11,720
We do not have any TAM or rescue temple here, right?

63
00:04:12,530 --> 00:04:15,350
So only the function in which we are.

64
00:04:16,310 --> 00:04:20,030
All the local variable will be highlighted right now.

65
00:04:20,180 --> 00:04:27,650
I pointed out I at 13 and here we have an eye 13 function, so let me just step inside this function.

66
00:04:27,680 --> 00:04:30,560
So the first option that will help is going inside.

67
00:04:30,560 --> 00:04:37,970
The function is stepping to make sure as soon as we had sipping do so, we are inside and at right vaccinés

68
00:04:37,970 --> 00:04:44,200
we are inside and at 13, you could see now all the local variables are highlighted, right?

69
00:04:44,240 --> 00:04:50,600
So you have an E who gave me to that argument that use every pass and say, given that we have this

70
00:04:50,630 --> 00:04:55,010
tip, great now since we are here, so it is not initialized yet.

71
00:04:55,400 --> 00:04:55,720
OK?

72
00:04:55,910 --> 00:05:01,670
So you could see the evaluate that is the value of a count variable after four for loop accretion companies,

73
00:05:01,670 --> 00:05:07,550
that is to be energy, OK, which has been updated and temp is yet to initialize so you can just click

74
00:05:07,550 --> 00:05:08,800
on step and do OK.

75
00:05:08,810 --> 00:05:11,690
So this will take us to the next statement.

76
00:05:11,780 --> 00:05:17,480
So E value is now zero, and since it is updated so you could see it is marked within an aluminum right,

77
00:05:17,480 --> 00:05:20,670
so you could argue one step and two.

78
00:05:20,750 --> 00:05:27,970
So this will take us to the next concert and then finally will be coming out of our activity.

79
00:05:28,040 --> 00:05:31,310
OK, so after we come out of an that you could now see?

80
00:05:32,330 --> 00:05:39,680
As we move on to the next function, OK, so I just 13 is updated to three one three and that is highlighted

81
00:05:40,090 --> 00:05:40,790
look right.

82
00:05:41,180 --> 00:05:45,650
So from here, you could clearly see if we step in to a function.

83
00:05:45,980 --> 00:05:52,100
OK, if you want to analyze the values of available which are local to certain function, then you need

84
00:05:52,100 --> 00:05:54,320
to mandatorily step in to a function.

85
00:05:54,620 --> 00:06:00,950
And then you could analyze the while right now, something interesting to observe over here is the only

86
00:06:00,950 --> 00:06:07,040
difference between the previous function that is at 39 squares in an act that we haven't utilized a

87
00:06:07,050 --> 00:06:08,120
global variable, right?

88
00:06:08,150 --> 00:06:12,320
But here you could really see we are utilizing a global rating, right?

89
00:06:12,560 --> 00:06:18,320
So if you just step inside the square function, let's see whether we will do an the global rating,

90
00:06:18,320 --> 00:06:18,630
right?

91
00:06:18,650 --> 00:06:21,830
So we will be utilizing step into.

92
00:06:22,400 --> 00:06:22,760
OK.

93
00:06:23,180 --> 00:06:29,900
So as we enter into the square function, you could see the variable which are local to square are been

94
00:06:30,140 --> 00:06:35,390
reflected in any area would be right to be happy and square 10, which have been added in.

95
00:06:35,390 --> 00:06:36,080
And they will be.

96
00:06:36,130 --> 00:06:40,760
But we are not seeing a global edible over here, right?

97
00:06:40,770 --> 00:06:41,090
So.

98
00:06:42,090 --> 00:06:43,020
Whenever we.

99
00:06:44,010 --> 00:06:49,710
I had a global variable inside the functions of the Ed Norton character, medically added into variable

100
00:06:49,710 --> 00:06:55,050
rate, so to analyze them the simplest strategies you will select and a variable.

101
00:06:55,330 --> 00:07:02,100
Right now we have selected it right click and then you have an option to add to watch expression.

102
00:07:02,550 --> 00:07:05,840
So we'll just be adding an expression and then click, OK.

103
00:07:05,880 --> 00:07:08,490
So here we just need to specify the name of the variable.

104
00:07:08,490 --> 00:07:09,180
Click OK.

105
00:07:09,510 --> 00:07:14,060
And then you could see that we have one more tab, which is either that is expression.

106
00:07:14,070 --> 00:07:18,890
OK, so the breakpoint highlight the specific position where we have had it every point.

107
00:07:19,260 --> 00:07:26,100
Variable indicator variables which are local to the specific function where we are in an expression

108
00:07:26,100 --> 00:07:29,550
is used to analyze the user defined expression.

109
00:07:29,700 --> 00:07:34,170
OK, so this may include the global variable right here.

110
00:07:34,440 --> 00:07:40,440
So global is not been included even when we are inside the square right now, if we just try to execute

111
00:07:40,440 --> 00:07:41,880
by utilizing step into.

112
00:07:42,630 --> 00:07:43,800
OK, so now.

113
00:07:44,740 --> 00:07:51,160
You could see the values of labor, so if you just updated the values of labor, you could actually

114
00:07:51,160 --> 00:07:53,160
reflect the changes you were here.

115
00:07:53,770 --> 00:07:54,040
Right?

116
00:07:54,700 --> 00:07:56,080
So this is the strategy.

117
00:07:56,080 --> 00:08:02,080
Then you want to analyze a user defined expression or a global view, but you need to take the help

118
00:08:02,080 --> 00:08:03,640
off and watch expression, right?
