1
00:00:02,550 --> 00:00:03,300
Hi, everyone.

2
00:00:03,390 --> 00:00:04,620
Welcome back to the cause.

3
00:00:05,100 --> 00:00:08,400
So today we will learn a new concept called appointers.

4
00:00:09,810 --> 00:00:11,880
So Boynton's is a very interesting topic.

5
00:00:12,630 --> 00:00:13,680
So let's start.

6
00:00:15,810 --> 00:00:17,230
And I question.

7
00:00:17,620 --> 00:00:18,480
So what will happen?

8
00:00:18,540 --> 00:00:20,330
I will get food by itself.

9
00:00:20,330 --> 00:00:21,150
Memory Speace.

10
00:00:24,690 --> 00:00:27,480
Dan is stored here now in the next line.

11
00:00:27,540 --> 00:00:33,480
If I try and print the value of I so want to live my output, my output will be 10.

12
00:00:35,320 --> 00:00:38,870
But how a system knows Veis, actually, I stood.

13
00:00:39,900 --> 00:00:40,590
Any guesses?

14
00:00:41,550 --> 00:00:44,190
So we have something called Simbel Table.

15
00:00:47,240 --> 00:00:52,050
The symbol table is generated by a compiler at the completion time.

16
00:00:53,260 --> 00:00:55,400
So symbol table is actually a map.

17
00:00:56,630 --> 00:00:57,410
It will store.

18
00:00:57,540 --> 00:01:02,680
There is a variable fly and the variable eye has got a memory base of 700.

19
00:01:03,320 --> 00:01:06,020
So this has a memory address of seven ended.

20
00:01:06,590 --> 00:01:09,560
So when I am printing the value of I, what will happen?

21
00:01:09,860 --> 00:01:13,030
The compiler will search I in the symbol table.

22
00:01:13,460 --> 00:01:14,810
Yes, there is a variable.

23
00:01:14,850 --> 00:01:19,280
I and the variable I is present at memory address seven ended.

24
00:01:19,670 --> 00:01:25,910
So I will go to I mean sys system will go to seven hundred and it will print ten.

25
00:01:27,700 --> 00:01:27,980
OK.

26
00:01:28,520 --> 00:01:35,580
So as soon as you create a variable, for example, Entergy, the variable G has to make an entry into

27
00:01:35,640 --> 00:01:36,440
Simbel Table.

28
00:01:36,500 --> 00:01:38,880
Suppose the addresses 794.

29
00:01:40,220 --> 00:01:45,950
Similarly, if you create an either variable galaxy, so she will make an entry in decimal table, suppose

30
00:01:45,950 --> 00:01:47,600
that does is it ended?

31
00:01:48,440 --> 00:01:48,680
OK.

32
00:01:48,920 --> 00:01:54,170
So as soon as you create a variable, that variable has to make an entry in the symbol table.

33
00:01:55,470 --> 00:01:58,010
Now, symbol table stored many information.

34
00:01:58,340 --> 00:02:03,800
For example, it will store the name of the variable and the memory address apart from it.

35
00:02:03,920 --> 00:02:04,900
It will also store.

36
00:02:05,300 --> 00:02:06,170
What is the type.

37
00:02:06,950 --> 00:02:15,200
Suppose I of integer and it will also store like what is the scope of I and many other informations.

38
00:02:16,010 --> 00:02:16,280
OK.

39
00:02:17,210 --> 00:02:21,410
So now what I want is I want to print this address.

40
00:02:21,500 --> 00:02:22,310
Seven hundred.

41
00:02:23,060 --> 00:02:25,520
I want to know veis actually I stored.

42
00:02:25,940 --> 00:02:27,730
I want to print its address.

43
00:02:28,580 --> 00:02:31,550
So we have something called address of Operator.

44
00:02:32,150 --> 00:02:33,700
So address off I.

45
00:02:34,850 --> 00:02:40,550
So if we will write C out address ofay I will get this address.

46
00:02:40,670 --> 00:02:41,420
Seven entered.

47
00:02:42,320 --> 00:02:42,650
OK.

48
00:02:43,010 --> 00:02:44,240
So let's see.

49
00:02:47,840 --> 00:02:51,440
So I have a myriad of file pointers in product CPB.

50
00:02:52,920 --> 00:02:54,060
Now I have a variable.

51
00:02:54,270 --> 00:02:55,940
And day it goes down.

52
00:02:59,070 --> 00:03:01,210
Now let us spend the I.

53
00:03:01,920 --> 00:03:03,560
So she yelled at myself.

54
00:03:03,960 --> 00:03:04,170
I.

55
00:03:12,780 --> 00:03:18,820
So this is the memo that herself off I so if you remember, I have already told you that the this is

56
00:03:18,840 --> 00:03:20,580
stored in hexadecimal Lemba system.

57
00:03:20,910 --> 00:03:22,500
So this is in hexadecimal.

58
00:03:22,590 --> 00:03:23,310
No system.

59
00:03:27,290 --> 00:03:32,550
Now, what I more know is so now I want to store address off I.

60
00:03:34,100 --> 00:03:37,150
So we need a data type that was stored at this off.

61
00:03:37,490 --> 00:03:37,730
I.

62
00:03:39,110 --> 00:03:43,310
So it gad flawed.

63
00:03:46,850 --> 00:03:50,270
Any of these three gone to the address of a very.

64
00:03:51,750 --> 00:03:53,820
So we have something called pointers.

65
00:03:54,540 --> 00:04:02,460
So at this point, the point is actually a variable that will store the address of other variables.

66
00:04:02,790 --> 00:04:05,490
So a variable that will store.

67
00:04:07,430 --> 00:04:09,680
Address of the variables.

68
00:04:12,860 --> 00:04:14,920
This is the standard definition of a point.

69
00:04:15,810 --> 00:04:18,500
OK, so Blinda.

70
00:04:20,310 --> 00:04:21,590
B equals.

71
00:04:21,900 --> 00:04:23,190
And percent of I.

72
00:04:23,760 --> 00:04:28,100
So point B, B is A pointer that will store the address of I.

73
00:04:28,860 --> 00:04:29,160
OK.

74
00:04:29,610 --> 00:04:31,230
So this is actually wrong.

75
00:04:32,160 --> 00:04:33,420
We can't write like this.

76
00:04:33,450 --> 00:04:36,570
I would tell you in very short time why this is wrong.

77
00:04:37,620 --> 00:04:44,640
So suppose B's containing 700, so P is containing 700.

78
00:04:44,790 --> 00:04:46,050
So this is my variability.

79
00:04:47,680 --> 00:04:49,350
This is variable rarely addresses.

80
00:04:49,470 --> 00:04:51,320
So it ended and value is ten.

81
00:04:52,020 --> 00:04:53,600
So be is storing 700.

82
00:04:53,700 --> 00:04:56,460
That means I can access 10 from here.

83
00:04:58,200 --> 00:05:05,470
OK, so what I want know is go to memory or does it say 100 and tell me what is it there?

84
00:05:07,020 --> 00:05:07,300
OK.

85
00:05:07,770 --> 00:05:11,250
So what I want now is go to memory or does seven.

86
00:05:11,820 --> 00:05:14,040
And tell me what is written there.

87
00:05:15,090 --> 00:05:19,470
So can you tell me the answer is you can't my.

88
00:05:21,310 --> 00:05:24,400
Because you don't know how many bites to read.

89
00:05:26,940 --> 00:05:35,280
This is so unhindered, so a when so under two and seven under three.

90
00:05:35,700 --> 00:05:38,280
So one bite, one bite, one bite and one bite.

91
00:05:39,330 --> 00:05:45,040
And suppose the number is so this is my number and memory.

92
00:05:45,280 --> 00:05:46,010
So it ended.

93
00:05:46,590 --> 00:05:50,450
So I want to go to memory of this 700.

94
00:05:50,580 --> 00:05:52,290
And tell me what is written there.

95
00:05:52,920 --> 00:05:55,890
And I am telling you that you can't answer this question.

96
00:05:56,200 --> 00:05:56,400
Why?

97
00:05:56,880 --> 00:05:59,310
Because you don't know how many bites to read.

98
00:06:01,130 --> 00:06:05,870
So suppose I told you somehow you got to know that we have to read for Bite's.

99
00:06:06,990 --> 00:06:07,220
OK.

100
00:06:07,570 --> 00:06:14,710
So as you somehow we got to know that we have to do it for right now, can you tell me how to intubate

101
00:06:14,710 --> 00:06:15,610
those four bites?

102
00:06:17,060 --> 00:06:20,480
What I want to say is, suppose I give you four bites.

103
00:06:21,520 --> 00:06:23,470
Now, tell me the meaning of this photo by its.

104
00:06:24,950 --> 00:06:26,760
You can tell why.

105
00:06:27,500 --> 00:06:33,050
Because these four bites might be representing four different characters.

106
00:06:33,860 --> 00:06:36,460
These four bites might be one fluid.

107
00:06:37,760 --> 00:06:44,240
These four bites might be representing half size of a double half size of a double.

108
00:06:44,280 --> 00:06:49,400
Basically, I give you first four bites, first four bites of eight by.

109
00:06:51,350 --> 00:06:53,300
So these four bites can be anything.

110
00:06:57,050 --> 00:07:03,380
So we are facing two difficulties here with the help of this representation, with the help of point

111
00:07:03,380 --> 00:07:04,100
thirty to type.

112
00:07:06,020 --> 00:07:10,610
And there are two difficulties are first, I don't know how many bites to read.

113
00:07:12,320 --> 00:07:18,850
Second, if I know that I have to root for bites, then I don't know how to interpret those four bites.

114
00:07:19,730 --> 00:07:23,540
Those four bites might be four characters when fluid half size over the bowl.

115
00:07:23,600 --> 00:07:24,530
Basically anything.

116
00:07:25,850 --> 00:07:28,970
So there are two difficulties in this representation.

117
00:07:29,300 --> 00:07:31,610
Hence, this representation is wrong.

118
00:07:33,160 --> 00:07:33,480
OK.

119
00:07:35,530 --> 00:07:40,660
So when we write for into B equals M percent Towfigh.

120
00:07:41,290 --> 00:07:49,660
So once I have the address of I in point B in the next lane, there is no way for me to see what is

121
00:07:49,720 --> 00:07:52,920
exactly stored at memory at this seven hundred.

122
00:07:53,440 --> 00:07:56,140
That information is just not available to me.

123
00:07:57,360 --> 00:08:00,920
OK, so how do we create pointers?

124
00:08:02,090 --> 00:08:03,860
So we create pointers like this.

125
00:08:08,220 --> 00:08:09,540
Now, how do read this line?

126
00:08:11,120 --> 00:08:15,140
B is a pointer pointing to an integer.

127
00:08:16,160 --> 00:08:19,580
So we will read from right to left.

128
00:08:21,250 --> 00:08:21,970
One more time.

129
00:08:22,900 --> 00:08:26,880
B is a pointer pointing to an integer.

130
00:08:27,610 --> 00:08:29,470
Now this all votes the problem.

131
00:08:30,370 --> 00:08:33,790
So the first problem was, I don't know how many bytes to read.

132
00:08:34,540 --> 00:08:36,250
So how many bytes?

133
00:08:38,260 --> 00:08:38,970
To read.

134
00:08:40,310 --> 00:08:47,830
Now I know how many bikes read because I have it here, so I know that I will go to memory at this seven

135
00:08:47,840 --> 00:08:50,330
ended and I will read for Bite's.

136
00:08:51,810 --> 00:08:56,910
Seven zero three and seven zero one and seven zero two.

137
00:08:57,720 --> 00:09:02,870
So the first problem is solved because of this in Beja.

138
00:09:03,090 --> 00:09:08,490
So I wouldn't go to memory this I attended and I will read forward by it because in BGA is up for debate.

139
00:09:09,570 --> 00:09:16,590
Now, the second problem was how to interpret those bytes, how to interpret.

140
00:09:18,840 --> 00:09:23,780
And this problem is also soiled because now I know that it is ending, T.J..

141
00:09:25,230 --> 00:09:29,290
So I will interpret this for bites as an integer.

142
00:09:30,960 --> 00:09:34,650
Now, both the problems are solved with this representation.

143
00:09:35,220 --> 00:09:37,390
So this representation is much, much better.

144
00:09:37,770 --> 00:09:42,300
And we will represent our pointers and we will make pointers using this approach.

145
00:09:42,870 --> 00:09:46,560
So the above approach, this approach is never used.

146
00:09:48,450 --> 00:09:50,980
OK, so let's see.

147
00:09:56,480 --> 00:10:02,990
So I have a point B, which is pointing to anybody here at least, or at this off I.

148
00:10:04,260 --> 00:10:06,890
Now let us try to print the value of P.

149
00:10:10,310 --> 00:10:15,130
So virtually my output, basically, Addazio, Fi and B bothof seem.

150
00:10:20,040 --> 00:10:21,030
So you can see here.

151
00:10:22,090 --> 00:10:27,720
Output of board and personal air doesn't fly and be both the same.

152
00:10:28,450 --> 00:10:30,220
OK, so memory addresses seem.

153
00:10:32,800 --> 00:10:34,960
Now, let us learn something more interesting.

154
00:10:41,430 --> 00:10:48,600
So let us talk about size of appointer, basically the size of appointer is fixed.

155
00:10:49,890 --> 00:10:55,470
So if you have a pointer which is containing that dustoff, an integer.

156
00:10:55,650 --> 00:11:02,490
So and I and you also have a pointer which will store that does have a character.

157
00:11:02,970 --> 00:11:07,080
So Canstar, let's say P2 is storing that dustoff.

158
00:11:07,200 --> 00:11:22,770
See, now, if I will bend the size of B and if I will try and print the size of B2, both output will

159
00:11:22,770 --> 00:11:24,180
be same size of both.

160
00:11:24,180 --> 00:11:31,010
The point does not seem if you will print the size of I.

161
00:11:31,620 --> 00:11:34,170
I will get forward by it because integer is of four.

162
00:11:34,170 --> 00:11:34,530
Right.

163
00:11:35,100 --> 00:11:39,420
And if you will print the size of C, you will get one byte.

164
00:11:40,110 --> 00:11:43,820
Martin, case of point does size will be seen.

165
00:11:44,460 --> 00:11:44,970
Let's see.

166
00:11:55,690 --> 00:12:00,720
Now, let us create a character pointer.

167
00:12:00,850 --> 00:12:02,310
So Gastar, let's see.

168
00:12:02,680 --> 00:12:09,460
BE2 is distorting the address of variable C.

169
00:12:21,120 --> 00:12:25,590
So the output of this line and the output of this line will be same.

170
00:12:26,370 --> 00:12:26,880
Let's see.

171
00:12:31,610 --> 00:12:33,800
So basically, four bites and four bites.

172
00:12:35,800 --> 00:12:37,600
So let me give and line here.

173
00:12:50,120 --> 00:12:52,770
So the size of I integer pointer is forward.

174
00:12:53,070 --> 00:12:55,800
And size of a connector pointer is also forward.

175
00:12:57,600 --> 00:13:03,300
Even though the size of India was four bites and the size of a character is one bite, but the size

176
00:13:03,300 --> 00:13:04,710
of the point that is seem.

177
00:13:06,590 --> 00:13:08,630
Now, let us try to understand why this happened.

178
00:13:11,310 --> 00:13:15,450
Suppose days, a 200 square yard house.

179
00:13:18,080 --> 00:13:22,640
So this is a small house, let's call it get.

180
00:13:24,170 --> 00:13:27,920
And we have 800 screamy art house.

181
00:13:30,790 --> 00:13:32,070
Let Scollard and.

182
00:13:35,830 --> 00:13:37,810
Now, let us talk about their addresses.

183
00:13:39,940 --> 00:13:47,950
So if this house is big and this houses small, that doesn't mean that this house address will be very

184
00:13:47,950 --> 00:13:51,940
long and this house address will be very small.

185
00:13:53,390 --> 00:13:54,960
The address is of both.

186
00:13:55,470 --> 00:13:57,280
The houses will be very similar.

187
00:13:58,200 --> 00:13:58,460
OK.

188
00:13:59,680 --> 00:14:10,390
So basically when we arrived and Star B equals and by Santa Fe, I just have to store the starting address.

189
00:14:11,130 --> 00:14:12,150
So be restored.

190
00:14:12,370 --> 00:14:12,940
700.

191
00:14:14,950 --> 00:14:21,790
Similarly, if you have a pointer, Gastar C equals M percent of C, so C will store just this starting

192
00:14:21,790 --> 00:14:22,840
at this later there.

193
00:14:22,900 --> 00:14:23,780
This is seven nine.

194
00:14:23,850 --> 00:14:27,640
Before we just have to store the starting address.

195
00:14:29,130 --> 00:14:35,940
That's why the size of the point that is fixed and can and this simple analogy will help you to understand

196
00:14:35,940 --> 00:14:36,450
it better.

197
00:14:37,860 --> 00:14:42,960
If a house is very big, that doesn't mean it's a dress will also be very big there.

198
00:14:43,280 --> 00:14:44,490
This will be compatible.

199
00:14:45,000 --> 00:14:48,390
That's why the size of the pointer is fixed in my system.

200
00:14:48,420 --> 00:14:49,320
It is four bytes.

201
00:14:49,980 --> 00:14:53,730
So this vary from compiler to compiler and from system to system.

202
00:14:54,880 --> 00:14:56,380
So this is it for this video.

203
00:14:56,440 --> 00:14:58,300
If you have any doubt, feel free to ask.

204
00:14:58,510 --> 00:14:59,770
I will see you the next one.

205
00:14:59,980 --> 00:15:00,510
Thank you.
