1
00:00:02,090 --> 00:00:02,780
Hello everyone.

2
00:00:02,780 --> 00:00:08,650
So in the last session we learned what operate our loading is and we'll order three of those plus multiply

3
00:00:08,810 --> 00:00:11,510
equal operate that for our reflection class.

4
00:00:11,600 --> 00:00:14,950
So I hope now everyone understand what is Oprah downloading.

5
00:00:15,050 --> 00:00:16,880
And how can you overload operators.

6
00:00:17,180 --> 00:00:20,020
So in this session we will overload few model printers.

7
00:00:20,310 --> 00:00:22,460
OK so first of all we will overload.

8
00:00:22,490 --> 00:00:28,390
Plus plus operators so in this session we will overload plus plus operator.

9
00:00:28,700 --> 00:00:31,050
So there are two versions of plus plus operator.

10
00:00:31,070 --> 00:00:32,480
One is pre increment

11
00:00:37,130 --> 00:00:44,210
and another one is post increment so I hope everyone knows what is there difference between pre and

12
00:00:44,210 --> 00:00:45,920
post increment.

13
00:00:45,920 --> 00:00:49,960
So in this class it will focus on being element.

14
00:00:50,110 --> 00:00:50,610
Okay.

15
00:00:50,660 --> 00:00:55,790
So in this video we will cover bringing equipment in the next we do we will try to cover post increment.

16
00:00:56,250 --> 00:00:56,800
Okay.

17
00:00:56,900 --> 00:01:05,430
So let's start today's class so when I write let's take an example.

18
00:01:05,430 --> 00:01:14,020
So when I write in days 5 and a blessed place and if I tried to print the value of a So what will be

19
00:01:14,030 --> 00:01:19,790
our output Sorry I will loop plus plus item because in this video we are trying to cover increment.

20
00:01:19,960 --> 00:01:21,940
So our output will be six.

21
00:01:22,000 --> 00:01:22,450
Okay.

22
00:01:22,510 --> 00:01:23,800
So what will happen at this line.

23
00:01:23,800 --> 00:01:25,450
I will get a memory block I.

24
00:01:25,510 --> 00:01:27,060
And it contains the value five.

25
00:01:27,170 --> 00:01:32,450
So plus plus I means make the value six and then we will print the value six.

26
00:01:32,470 --> 00:01:37,900
Okay so now we want to overload the pre increment operator for our section class.

27
00:01:37,900 --> 00:01:46,560
So let us take a fraction so that this trick affection EF 1 so with affection EF 1 the value of numerator

28
00:01:46,640 --> 00:01:49,060
is 10 and the value of denominators 2.

29
00:01:49,110 --> 00:01:58,970
So when I write plus plus EF 1 So what will happen then by 2 plus 1 which is 10 plus two my do which

30
00:01:58,970 --> 00:02:02,000
is trial by two and then we will call the simplify function.

31
00:02:02,000 --> 00:02:05,110
So it will become 6 by 1 OK.

32
00:02:05,290 --> 00:02:08,380
So if you remember in the last session we all did plus operator.

33
00:02:08,770 --> 00:02:13,270
So EF 3 is EF 1 plus EF 2.

34
00:02:13,800 --> 00:02:14,080
OK.

35
00:02:14,080 --> 00:02:17,710
So if you look carefully this plus operator is a binary operator.

36
00:02:17,770 --> 00:02:24,280
So what is a binary operator are by NATO operators operator which needs to operate to do this work.

37
00:02:24,680 --> 00:02:25,050
OK.

38
00:02:25,060 --> 00:02:27,390
Which need to print to do its work.

39
00:02:27,460 --> 00:02:32,410
So in today's class we are covering being called many operators of pre increment operator is the unity

40
00:02:32,410 --> 00:02:33,430
operator.

41
00:02:33,430 --> 00:02:38,060
So are you NATO operator needs only one or brand to do its work.

42
00:02:38,080 --> 00:02:39,970
So in this case what will happen.

43
00:02:39,970 --> 00:02:45,540
EF 1 will go in this and F2 will be passed this argument okay.

44
00:02:45,780 --> 00:02:53,940
But for the case of plus plus operator since it's a unity operator F1 will go in this and we do not

45
00:02:53,940 --> 00:02:56,510
need to pass anything in the arguments.

46
00:02:56,510 --> 00:02:56,970
Okay.

47
00:02:57,090 --> 00:03:01,330
So let us try to overload let us try to order the being current operator okay.

48
00:03:01,350 --> 00:03:05,660
So let the scene code.

49
00:03:05,760 --> 00:03:08,220
So what is the return type.

50
00:03:08,310 --> 00:03:16,120
So we are overloading increment number two the return type of the function.

51
00:03:16,120 --> 00:03:17,800
So we are not returning anything.

52
00:03:17,800 --> 00:03:20,810
So for now let us assume the return type is void.

53
00:03:20,830 --> 00:03:21,220
Okay.

54
00:03:21,340 --> 00:03:23,630
We will do changes in direction only.

55
00:03:23,650 --> 00:03:26,580
So for now let us assume the return type is void.

56
00:03:26,590 --> 00:03:33,060
Okay then we have to write operate a keyword and without space the operator which won't overload C++

57
00:03:33,610 --> 00:03:37,440
as we discussed we will not take any friction as argument.

58
00:03:37,720 --> 00:03:41,250
And now let us change the numerator.

59
00:03:41,270 --> 00:03:41,770
Okay.

60
00:03:41,880 --> 00:03:45,920
So when we do plus plus everyone only the numerator will change.

61
00:03:45,920 --> 00:03:50,110
So the numerator will become numerator

62
00:03:53,770 --> 00:03:55,960
plus denominator.

63
00:03:55,960 --> 00:03:59,780
Okay and then determinative will remain the same.

64
00:03:59,830 --> 00:04:02,020
And then we have to call simplify function.

65
00:04:02,050 --> 00:04:02,310
Okay.

66
00:04:02,320 --> 00:04:05,530
We have to call simplify function so simplify.

67
00:04:06,310 --> 00:04:08,230
Okay so let's see how it will work.

68
00:04:13,920 --> 00:04:16,280
So I will call it a fiction.

69
00:04:16,290 --> 00:04:17,890
I will call this function.

70
00:04:17,980 --> 00:04:18,780
Plus everyone.

71
00:04:19,350 --> 00:04:24,930
So let's say numerator and denominator is ten by two then in two.

72
00:04:25,050 --> 00:04:29,530
And this is my friction F1 and the addresses 700.

73
00:04:29,610 --> 00:04:32,370
Okay so at this lane what will happen.

74
00:04:32,490 --> 00:04:35,990
This will contain at best seven hundred.

75
00:04:36,140 --> 00:04:39,200
And when I write numerator is numerator plus Newman a denominator.

76
00:04:39,410 --> 00:04:45,110
So it will become ten plus two and denominator will remain the same which is two and then we are calling

77
00:04:45,110 --> 00:04:46,170
the simplified function.

78
00:04:46,400 --> 00:04:48,730
So if we call the simplified function on twelve by two.

79
00:04:48,740 --> 00:04:50,480
It will become six by 1.

80
00:04:50,480 --> 00:04:50,980
Okay.

81
00:04:51,040 --> 00:04:52,340
Travel code is working fine.

82
00:04:52,340 --> 00:05:09,400
Now let us best have called uh let's first comment out everything.

83
00:05:09,440 --> 00:05:13,370
Now let us first try to print the value of f1.

84
00:05:13,370 --> 00:05:22,970
So I found out print and now we will do being driven to plus plus F1 and then we will again print the

85
00:05:22,970 --> 00:05:23,950
value of f1.

86
00:05:23,960 --> 00:05:27,610
OK so let's send our file.

87
00:05:27,750 --> 00:05:31,260
So first we have to run this and now we will run this

88
00:05:34,220 --> 00:05:36,340
so the output produce six by one.

89
00:05:36,340 --> 00:05:38,120
Initially it was 10 by two.

90
00:05:38,170 --> 00:05:38,470
Okay.

91
00:05:38,500 --> 00:05:41,360
So then by two plus 1 it will become twelve by two.

92
00:05:41,470 --> 00:05:43,000
And then the simplify function.

93
00:05:43,000 --> 00:05:44,650
So our output is six by one.

94
00:05:44,710 --> 00:05:44,940
Okay.

95
00:05:44,950 --> 00:05:46,500
So our code is working fine.

96
00:05:46,660 --> 00:05:48,550
Now let's analyze it a bit more.

97
00:05:49,150 --> 00:05:49,880
Okay.

98
00:05:49,960 --> 00:05:58,480
So what will happen if I write if I write in day is five.

99
00:05:58,680 --> 00:06:02,160
Then can I write into J is plus plus I.

100
00:06:03,650 --> 00:06:04,140
Okay.

101
00:06:04,200 --> 00:06:10,890
And then if I tried to print the value of i n g c I would die and c LG.

102
00:06:10,980 --> 00:06:14,240
So what will our output our output will be six and 6.

103
00:06:14,250 --> 00:06:16,970
So at this line which will happen I will get a memory block.

104
00:06:17,010 --> 00:06:18,800
And it contains the value 5.

105
00:06:19,080 --> 00:06:20,580
Then we are doing plus plus 8.

106
00:06:20,610 --> 00:06:25,480
So it will become 6 and then we are creating a memory block J.

107
00:06:25,530 --> 00:06:30,560
So the 6 value will be will get copied here and then if we print the value of I enjoy.

108
00:06:30,560 --> 00:06:32,750
So 6 and 6 will be our output.

109
00:06:32,750 --> 00:06:33,220
Okay.

110
00:06:33,330 --> 00:06:39,650
So currently can we do like we have all audited the plus operator for a fraction class go.

111
00:06:39,660 --> 00:06:46,430
So can we do this function F two is plus plus F one cannot do this okay.

112
00:06:46,450 --> 00:06:49,090
So let's try to understand whether we can do this or not

113
00:06:51,840 --> 00:06:56,490
so let's come on down this code.

114
00:06:56,520 --> 00:07:04,380
So what I want is fiction F3 which is plus plus everyone.

115
00:07:04,430 --> 00:07:04,890
Okay.

116
00:07:04,980 --> 00:07:06,700
So can we do this.

117
00:07:06,930 --> 00:07:13,710
And after doing it for nought point let's also print F3 okay.

118
00:07:13,850 --> 00:07:15,640
So now let's send this file.

119
00:07:16,420 --> 00:07:17,590
So we are getting an error.

120
00:07:17,590 --> 00:07:25,600
This line and that is let's see that it so that it is the return type of the function operator plus

121
00:07:25,600 --> 00:07:26,530
plus is void.

122
00:07:26,650 --> 00:07:29,040
And on the left hand side we have written a fraction.

123
00:07:29,470 --> 00:07:30,030
Okay.

124
00:07:30,160 --> 00:07:32,410
So this is wrong.

125
00:07:32,500 --> 00:07:38,540
So if you cant see the return type of the function operator plus blesses void and what I would rank

126
00:07:38,590 --> 00:07:45,010
do here is this function is not attending anything and in the left hand side we have written object

127
00:07:45,010 --> 00:07:46,430
of type function.

128
00:07:46,530 --> 00:07:46,780
Okay.

129
00:07:46,810 --> 00:07:52,970
So obviously this will throw us at it okay so what I want to do is I want to make this thing work.

130
00:07:53,630 --> 00:07:54,710
Okay so what will happen.

131
00:07:54,740 --> 00:08:01,610
I will write code in such a way that first F when we get updated and then the value of f1 will get copied

132
00:08:01,610 --> 00:08:15,280
in F3 Okay so what we want is so when we ride in the G is less plus a so.

133
00:08:15,380 --> 00:08:19,270
If I was initially five So this is I.

134
00:08:19,280 --> 00:08:20,640
And it contains a value five.

135
00:08:20,660 --> 00:08:21,640
So what will happen.

136
00:08:21,770 --> 00:08:26,290
First I will get a bullet so it will become six then a memory block.

137
00:08:26,300 --> 00:08:31,430
Jay will be created and then the value 6 will get copied.

138
00:08:31,430 --> 00:08:34,280
Okay so I will do the same.

139
00:08:34,280 --> 00:08:40,990
First I will update the function F1 so the function F1 if it was initially 10 and denominator was 2.

140
00:08:41,090 --> 00:08:48,560
So first the friction F1 will get updated so it will become 6 by 1 and then we will copy the value and

141
00:08:48,560 --> 00:08:50,200
2 friction F3.

142
00:08:50,330 --> 00:08:56,150
Okay so the return type of the plus plus operator plus both function has to be a fraction.

143
00:08:56,270 --> 00:08:57,540
Okay so let's see.

144
00:09:01,470 --> 00:09:06,730
So initially with hard return type will be void but now we know that it and will be affection.

145
00:09:06,750 --> 00:09:09,340
Okay so then babies friction.

146
00:09:10,020 --> 00:09:15,530
Now after updating the current friction we have to return this friction.

147
00:09:15,540 --> 00:09:17,650
So return this.

148
00:09:17,710 --> 00:09:18,090
Return.

149
00:09:18,130 --> 00:09:19,650
This is this line.

150
00:09:19,660 --> 00:09:20,680
Correct.

151
00:09:20,680 --> 00:09:23,070
Should we return this or should we return something else.

152
00:09:24,070 --> 00:09:24,970
So let's see.

153
00:09:29,410 --> 00:09:35,870
So as you look carefully when I write in the J is blessed plus a.

154
00:09:36,040 --> 00:09:37,060
So what I'm returning.

155
00:09:37,090 --> 00:09:39,010
So the value of i really initially was 5.

156
00:09:39,010 --> 00:09:40,190
Now it becomes 6.

157
00:09:40,300 --> 00:09:44,740
So I am returning 6 I am returning the content.

158
00:09:44,740 --> 00:09:45,540
Okay.

159
00:09:45,830 --> 00:09:51,980
Now let's say the friction F1 the friction F1 has memory address 7 700.

160
00:09:52,090 --> 00:09:59,740
So this contains the operator plus plus this contains an address so intended and the numerator and denominator

161
00:09:59,770 --> 00:10:01,000
gets updated.

162
00:10:01,030 --> 00:10:02,580
Initially it was trained by two.

163
00:10:02,620 --> 00:10:04,570
So now it's become 6 by 1.

164
00:10:04,570 --> 00:10:05,220
Okay.

165
00:10:05,230 --> 00:10:08,560
So I have what I'm doing here is I am returning this.

166
00:10:08,560 --> 00:10:14,680
This contains the address this contains 700 but we do not have to return 7 and we have to return the

167
00:10:14,680 --> 00:10:17,370
content we have to return the content.

168
00:10:17,380 --> 00:10:21,250
Okay so for returning the content what we will do we will then start this.

169
00:10:21,370 --> 00:10:22,210
Okay.

170
00:10:22,360 --> 00:10:27,640
We have two right return stop this because we have to return the content.

171
00:10:27,820 --> 00:10:34,850
Okay so we have to right start this because we want to down the content.

172
00:10:35,130 --> 00:10:41,980
Okay so let's end this file and now I believe there should be no error at this line.

173
00:10:42,120 --> 00:10:42,720
Okay.

174
00:10:42,720 --> 00:10:46,910
So I am printing the will of F1 and F3 both will be same.

175
00:10:46,960 --> 00:10:48,600
Okay so let us try to run our code

176
00:10:53,560 --> 00:10:59,320
so we can see initially the value of friction F1 is ten by two then we are printing the value of f1

177
00:10:59,350 --> 00:11:00,640
after doing plus plus F1.

178
00:11:00,640 --> 00:11:02,550
And this is the value of action F3.

179
00:11:02,990 --> 00:11:05,470
Okay so our code is working fine.

180
00:11:05,470 --> 00:11:06,030
Okay.

181
00:11:06,220 --> 00:11:09,530
So now let's try to analyse one more thing.

182
00:11:11,980 --> 00:11:15,630
So now we will analyse one more thing.

183
00:11:15,640 --> 00:11:15,900
Okay.

184
00:11:15,910 --> 00:11:29,770
So what happened is when I write and I know if I do plus plus plus plus I and if I tried to print the

185
00:11:29,770 --> 00:11:36,970
value of i let's say they initially initially the value of i was 5 then c out a bit will you add output.

186
00:11:37,090 --> 00:11:44,350
So an output will be 7 by 7 because at this line I will get a memory block i.e. this contains the value

187
00:11:44,400 --> 00:11:49,930
5 then first this operator will get work this operator will work.

188
00:11:49,930 --> 00:11:52,770
So it becomes six then again plus plus.

189
00:11:52,780 --> 00:11:54,370
So it becomes seven.

190
00:11:54,550 --> 00:11:56,180
So it output is seven.

191
00:11:56,730 --> 00:11:57,180
Okay.

192
00:11:57,280 --> 00:11:59,900
So can we do that same thing on fiction.

193
00:11:59,920 --> 00:12:05,750
So what I want to do is the list called work plus plus plus plus F1.

194
00:12:05,950 --> 00:12:06,760
So will it work.

195
00:12:08,320 --> 00:12:15,940
So first plus plus we'll work on F1 and we know this function returns a fraction desolate and affection

196
00:12:15,970 --> 00:12:18,880
and then this plus plus will work on distraction.

197
00:12:18,880 --> 00:12:20,730
So ideally it should work.

198
00:12:20,830 --> 00:12:21,120
Okay.

199
00:12:21,130 --> 00:12:21,950
I later work.

200
00:12:21,970 --> 00:12:23,240
So let's try.

201
00:12:23,440 --> 00:12:24,580
Whether it will work or not.

202
00:12:24,880 --> 00:12:25,140
Okay

203
00:12:27,980 --> 00:12:29,540
so let's comment out of the thing

204
00:12:34,980 --> 00:12:38,680
so what we want is we want nested.

205
00:12:38,850 --> 00:12:44,610
So we are doing we are using nested operators we are doing nesting here.

206
00:12:44,670 --> 00:12:46,470
So plus plus plus plus F1.

207
00:12:46,530 --> 00:12:48,570
So will it look.

208
00:12:48,570 --> 00:12:53,790
So after doing this let us try to print the value of f1 and let's see whether it will work or not.

209
00:12:54,210 --> 00:13:03,090
So we have found out print Okay and before doing this nesting thing we also print the value of f1.

210
00:13:03,100 --> 00:13:04,360
So F1 not print

211
00:13:07,430 --> 00:13:08,920
OK so what should be our output.

212
00:13:11,930 --> 00:13:16,630
So initially the numerator and denominator contains 10 by two.

213
00:13:16,650 --> 00:13:18,370
So this is my reflection F1.

214
00:13:18,500 --> 00:13:21,040
So first I will do plus press F1.

215
00:13:21,050 --> 00:13:26,910
So it will become do by two then simply have when got cold.

216
00:13:26,920 --> 00:13:34,040
So it becomes six by one then we are again calling plus plus on six by one so six by one plus one.

217
00:13:34,050 --> 00:13:35,680
So output should be seven by one.

218
00:13:35,920 --> 00:13:38,830
Okay so this is the expected output.

219
00:13:38,830 --> 00:13:41,260
This is expected output.

220
00:13:41,530 --> 00:13:43,390
So let's see what will add output

221
00:13:48,320 --> 00:13:51,070
so output is coming out to be 6 by 1.

222
00:13:51,110 --> 00:13:51,800
Okay.

223
00:13:51,800 --> 00:13:53,960
So this nesting thing is not working.

224
00:13:54,590 --> 00:13:59,020
Output is still coming out to be 6 by 1 whereas the expected output was 7 by 1.

225
00:13:59,030 --> 00:14:01,220
That means there is some problem in our understanding.

226
00:14:01,250 --> 00:14:04,100
Okay so there is something which is going wrong.

227
00:14:04,100 --> 00:14:07,040
Okay so far before analyzing it what went wrong.

228
00:14:07,040 --> 00:14:09,430
Let us try to move one more thing.

229
00:14:09,440 --> 00:14:10,490
Okay so what we will do

230
00:14:19,000 --> 00:14:28,350
let's try to write in this function so a function of three is plus plus plus plus F1 okay.

231
00:14:28,360 --> 00:14:30,910
And now let us spend the value of a finite after you.

232
00:14:30,910 --> 00:14:35,600
So if one dot Brent and F two dark and

233
00:14:40,120 --> 00:14:41,590
okay so what should be our output

234
00:14:44,630 --> 00:14:51,690
so as we see this value if we died to try to print this value it was coming out to be 6 by 1.

235
00:14:51,720 --> 00:14:56,850
So ideally what will happen both will be six by one F1 and F3 both will be 6 by 1.

236
00:14:57,160 --> 00:14:57,690
Okay.

237
00:14:57,840 --> 00:14:59,740
So what will happen actually.

238
00:14:59,970 --> 00:15:05,430
F1 will be 6 by 1 and F3 will become 7 by 1.

239
00:15:05,550 --> 00:15:05,930
Okay.

240
00:15:06,330 --> 00:15:11,520
So these two values will be different if one is 6 by 1 F3 is 7 by 1.

241
00:15:11,550 --> 00:15:17,120
Let's see.

242
00:15:17,210 --> 00:15:21,330
See I told you in F1 is 6 by 1 and have to use 7 by 1.

243
00:15:21,630 --> 00:15:23,000
Okay so why this is weird.

244
00:15:23,120 --> 00:15:25,510
So why this weird behaviour is coming out.

245
00:15:25,640 --> 00:15:28,100
So let us try to understand what happened.

246
00:15:28,130 --> 00:15:28,400
Okay

247
00:15:31,400 --> 00:15:36,820
so what happened is when we write into AI is 5.

248
00:15:38,020 --> 00:15:39,100
So what will happen.

249
00:15:39,280 --> 00:15:43,580
First of all there is a system before.

250
00:15:43,580 --> 00:15:46,610
These are temporary memory.

251
00:15:46,670 --> 00:15:50,860
This is a temporary memory system before it will contain the value 5.

252
00:15:51,010 --> 00:15:56,870
Okay then we will get memory allocated to variability.

253
00:15:56,900 --> 00:15:57,170
Okay.

254
00:15:57,200 --> 00:16:04,510
Then very well I will be created and this 5 value will be copied and then this 5 value will be copied

255
00:16:04,540 --> 00:16:07,270
and then this memory will get deleted.

256
00:16:07,270 --> 00:16:16,010
Okay so this is how it works let us try to understand it a bit more so suppose I have a function let's

257
00:16:16,010 --> 00:16:24,440
see I have a function and fun this function takes an integer variable as input then it will do a plus

258
00:16:24,440 --> 00:16:24,870
plus.

259
00:16:24,880 --> 00:16:26,200
And then it does it.

260
00:16:26,280 --> 00:16:27,640
DUNNING I

261
00:16:31,910 --> 00:16:36,770
and let's say this is our main program and we are calling the function from here.

262
00:16:37,280 --> 00:16:43,510
So we are doing Entergy and we are calling the function.

263
00:16:43,730 --> 00:16:47,780
I and let's say the value of IEEE is five.

264
00:16:47,990 --> 00:16:51,500
And then we are trying to print the value of G.

265
00:16:51,540 --> 00:16:57,590
Howard will work so when we call the function find five.

266
00:16:57,600 --> 00:16:58,720
So what will happen.

267
00:16:58,800 --> 00:17:00,530
This I will contain five.

268
00:17:01,150 --> 00:17:05,320
Okay so this I contains five.

269
00:17:05,420 --> 00:17:06,740
Then we do a plus plus.

270
00:17:06,770 --> 00:17:09,840
So it will become six and then we are returning a.

271
00:17:10,130 --> 00:17:10,580
Okay.

272
00:17:10,640 --> 00:17:12,560
So when we return what will happen.

273
00:17:12,560 --> 00:17:14,800
So when we come here what will happen.

274
00:17:14,810 --> 00:17:20,410
Our system memory again before we will created that buffer will contain the value 6.

275
00:17:20,420 --> 00:17:20,780
Okay.

276
00:17:20,840 --> 00:17:22,060
Similarly like this.

277
00:17:22,190 --> 00:17:22,970
What will happen.

278
00:17:22,970 --> 00:17:28,210
A system buffer system buffer which is a temporary memory will be created.

279
00:17:28,370 --> 00:17:31,110
And it contains the value 6.

280
00:17:31,430 --> 00:17:40,940
And then what will happen in the G so a box g a variable g the variable JS allocated memory and then

281
00:17:41,030 --> 00:17:48,590
the value 6 will get copied here and then the value 6 will get copied here and then it will see algae

282
00:17:48,740 --> 00:17:50,400
then 6 or liberated.

283
00:17:50,510 --> 00:17:56,240
Okay so this system buffer this temporary memory is created by the computer.

284
00:17:56,270 --> 00:17:56,610
Okay.

285
00:17:56,650 --> 00:18:01,300
So we are not doing anything this is created by the compiler or we can say the system.

286
00:18:01,340 --> 00:18:05,160
Okay so what will happen instead of writing this line.

287
00:18:05,780 --> 00:18:12,570
If I try to directly print if I will call the function using this using this line.

288
00:18:12,580 --> 00:18:14,390
What will happen.

289
00:18:14,570 --> 00:18:17,060
So what will happen this function.

290
00:18:17,060 --> 00:18:18,660
We will reach here again.

291
00:18:18,680 --> 00:18:20,010
I will contain 5.

292
00:18:20,210 --> 00:18:23,250
So then it will become 6 and then we are returning a.

293
00:18:23,780 --> 00:18:25,890
So when we are returning the value what will happen again.

294
00:18:26,030 --> 00:18:30,120
We will get a system before the system before.

295
00:18:30,120 --> 00:18:31,460
Let's call it x.

296
00:18:31,650 --> 00:18:34,300
So the system buffers contain the value 6.

297
00:18:34,500 --> 00:18:37,280
And now here we are not receiving it.

298
00:18:37,320 --> 00:18:37,650
Okay.

299
00:18:37,650 --> 00:18:38,790
Now we are not receiving it.

300
00:18:38,820 --> 00:18:40,080
So what the old will do.

301
00:18:40,080 --> 00:18:44,600
It will go to the system before and it will print this value.

302
00:18:44,680 --> 00:18:46,080
So 6 will get printed.

303
00:18:46,120 --> 00:18:52,720
Okay so c out will go to system before and it will read its value and it will print its value.

304
00:18:52,750 --> 00:18:59,550
So this way 6 will get printed Okay so we are not receiving anything here.

305
00:18:59,770 --> 00:19:00,970
We are not receiving anything.

306
00:19:00,970 --> 00:19:02,950
We are directly printing.

307
00:19:03,070 --> 00:19:05,620
Okay so for direct printing words the order will do.

308
00:19:05,620 --> 00:19:10,680
It will reach the system before it will reach the temporary memory and then it will print its value.

309
00:19:12,410 --> 00:19:12,940
Okay.

310
00:19:13,040 --> 00:19:17,700
So now let us see the same thing which is happening here.

311
00:19:17,930 --> 00:19:18,210
Okay.

312
00:19:18,230 --> 00:19:20,180
So how this will work.

313
00:19:20,180 --> 00:19:23,240
What is the edit here and how we can correct this error.

314
00:19:23,570 --> 00:19:25,130
So what is happening here is.

315
00:19:25,220 --> 00:19:31,060
So let's say our numerator is 10 and their denominator is 2.

316
00:19:31,190 --> 00:19:39,380
So this is our function F1 and let's say that at this is 700 and this is 700.

317
00:19:39,410 --> 00:19:40,380
So we are calling.

318
00:19:41,120 --> 00:19:44,890
So what we are doing here is we are writing something like this.

319
00:19:44,930 --> 00:19:51,220
So friction F3 is s plus plus plus F1.

320
00:19:52,110 --> 00:19:57,660
Okay so first of all we will operate on first plus plus.

321
00:19:57,660 --> 00:19:58,840
So what will happen.

322
00:19:58,890 --> 00:20:01,520
We will reach the function operator plus plus.

323
00:20:01,590 --> 00:20:09,390
So when we reach the function of ridiculous plus this will contain an address seven hundred and then

324
00:20:09,390 --> 00:20:11,780
the value of the numerator will get updated.

325
00:20:11,850 --> 00:20:17,600
So numerator will become six and the denominator will become one.

326
00:20:17,610 --> 00:20:19,950
So this is after the simplified function.

327
00:20:19,950 --> 00:20:22,410
So this is after the simplified function.

328
00:20:22,410 --> 00:20:25,550
And then if you see the code we are turning this friction.

329
00:20:25,560 --> 00:20:32,270
So this is currently at the 700 we Dunning distraction and I told you when we re done the friction what

330
00:20:32,280 --> 00:20:34,710
will happen it will go into the system before.

331
00:20:35,100 --> 00:20:35,640
Okay.

332
00:20:35,670 --> 00:20:40,860
So we are returning a fraction but we are not receiving it.

333
00:20:40,860 --> 00:20:42,830
So we are returning a fraction.

334
00:20:42,870 --> 00:20:44,710
I will reach the mean.

335
00:20:45,030 --> 00:20:45,870
Then what will happen.

336
00:20:45,870 --> 00:20:48,030
A system buffet will be created.

337
00:20:48,030 --> 00:20:51,750
It contains numerator is 6 and denominator is 1.

338
00:20:51,780 --> 00:20:53,490
So when we reach the mean.

339
00:20:53,790 --> 00:20:56,760
So the output of this is this one.

340
00:20:56,760 --> 00:20:58,430
So when we reach the mean.

341
00:20:58,620 --> 00:21:01,820
This is our temporary memory or we can say the system before.

342
00:21:01,880 --> 00:21:07,080
Let us call it X and let's say it s addresses 800.

343
00:21:07,860 --> 00:21:14,370
Okay then what we are doing here is plus plus since this function is returning something.

344
00:21:14,370 --> 00:21:15,720
But we are not receiving it.

345
00:21:16,080 --> 00:21:18,140
So what this plus plus will do.

346
00:21:18,450 --> 00:21:28,930
It will operate on this instead of operating on this one my blessed place will operate on this on the

347
00:21:29,290 --> 00:21:30,880
temporary memory.

348
00:21:31,120 --> 00:21:39,270
So what it will do now this time might this will convene address 800 and again the numerator will become

349
00:21:39,420 --> 00:21:42,940
numerator plus denominator so numerator and denominator will get updated.

350
00:21:43,110 --> 00:21:49,970
So it will become 7 and it will become when after the simplified function.

351
00:21:50,010 --> 00:21:50,230
Okay.

352
00:21:50,250 --> 00:21:57,660
So this is after this simplified function and then we will return this friction so we will return this

353
00:21:57,660 --> 00:22:04,710
friction to mean and when we are returning what will happen first of all a system memory or temporary

354
00:22:04,710 --> 00:22:06,810
memory will be created.

355
00:22:06,810 --> 00:22:11,160
So that temporary memory contains numerator is 7 and the denominator is 1.

356
00:22:11,190 --> 00:22:13,250
Let's say the name of this temporary memory is right.

357
00:22:13,290 --> 00:22:15,440
And let's say it's addresses 900.

358
00:22:15,780 --> 00:22:16,440
Okay.

359
00:22:16,470 --> 00:22:23,980
So after this what will happen a fraction EF 3 will be created a fraction EF 3 will be allocated to

360
00:22:23,980 --> 00:22:27,340
memory numerator and denominator.

361
00:22:27,470 --> 00:22:34,580
And then this value will get copied so numerator contains 7 and the denominator condensed 1.

362
00:22:34,610 --> 00:22:42,530
So when we do EF 1 dark print what will happen and when we do EF 2 dark print.

363
00:22:42,530 --> 00:22:52,710
So when we do EF underpinned so this is our F1 so it contains 6 by 1 and this is our EF 3 so it contains

364
00:22:53,040 --> 00:22:54,120
7 by 1.

365
00:22:54,230 --> 00:22:56,960
Okay so that is how intimately this is working.

366
00:22:58,330 --> 00:22:58,620
Okay.

367
00:22:58,650 --> 00:23:01,460
So that is how internally this is working.

368
00:23:01,540 --> 00:23:05,590
So how can we like how can we correct this method.

369
00:23:05,600 --> 00:23:12,910
Okay so what is happening it is the main problem is this thing this blessed place is getting operated

370
00:23:13,720 --> 00:23:18,390
on this system memory this temporary memory.

371
00:23:18,390 --> 00:23:18,870
Okay.

372
00:23:18,970 --> 00:23:24,570
And we want this plus plus short book on this address seven and eight only.

373
00:23:24,670 --> 00:23:31,120
Okay so we want this memory this temporary memory should not be created we want this temporary memory

374
00:23:31,120 --> 00:23:32,440
should not be created.

375
00:23:32,500 --> 00:23:32,830
Okay.

376
00:23:32,920 --> 00:23:39,140
Let us try to understand a bit more so what is happening it is initially the value of numerator Houston

377
00:23:39,230 --> 00:23:48,530
and then due to my dates to so we are doing plus plus plus plus F1.

378
00:23:48,770 --> 00:23:57,790
So first of all this plus plus will work on this one and its value will become 6 by 1 Okay.

379
00:23:57,970 --> 00:24:02,110
Then what will happen are temporary memory when we return the friction are temporary memory will be

380
00:24:02,110 --> 00:24:11,090
created a system before will be created so when we write return start this and when we reach the mean

381
00:24:11,090 --> 00:24:16,010
program a system memory will be created let's say it let's say the name is X and it contains the absolute

382
00:24:16,020 --> 00:24:16,490
hundred.

383
00:24:17,120 --> 00:24:23,890
So this time this plus plus is working on this one and we want this plus plus should work here only.

384
00:24:23,900 --> 00:24:29,240
Okay so what we can do is we will write code in such a way that this copy is not created.

385
00:24:29,240 --> 00:24:32,630
So if this copy is not good what will happen.

386
00:24:32,630 --> 00:24:37,500
My system memory my system before it will point here only.

387
00:24:37,530 --> 00:24:43,100
Okay so cannot live in the memories created the system before it points here.

388
00:24:43,100 --> 00:24:48,350
But if the system buffer is not created the copy is not created and the system buffer will point here

389
00:24:48,350 --> 00:24:48,770
only.

390
00:24:48,790 --> 00:24:55,090
Okay so before I will point here only and then this plus plus will bug on again work on this.

391
00:24:55,160 --> 00:24:57,950
And then this value will become 7 by 1.

392
00:24:58,100 --> 00:24:58,480
Okay.

393
00:24:58,580 --> 00:24:59,420
So what we want.

394
00:24:59,480 --> 00:25:04,520
We want copy should not be created copy should not be there.

395
00:25:04,580 --> 00:25:05,070
Okay.

396
00:25:05,150 --> 00:25:07,900
So whenever we want that copy should not be created.

397
00:25:07,910 --> 00:25:08,810
What we do.

398
00:25:08,960 --> 00:25:12,200
There is something called the reference.

399
00:25:13,130 --> 00:25:16,210
So we know passed by reference.

400
00:25:16,210 --> 00:25:18,900
We have to read about pass by reference.

401
00:25:18,910 --> 00:25:20,660
There is also with something.

402
00:25:20,680 --> 00:25:23,110
There is also which is called a return by reference

403
00:25:26,130 --> 00:25:29,990
Okay so we know what is passed by reference.

404
00:25:30,000 --> 00:25:32,890
There is something called written by Defense.

405
00:25:33,030 --> 00:25:37,590
So reference is used whenever we don't want to create a copy.

406
00:25:37,590 --> 00:25:40,320
So we will return the friction biodefense.

407
00:25:40,320 --> 00:25:44,490
So when we're done the function by defense the copy will not be created.

408
00:25:44,490 --> 00:25:48,400
Okay so the copy will not be created.

409
00:25:48,990 --> 00:25:54,430
So let's see one more time when we pass by value.

410
00:25:54,430 --> 00:26:02,770
So when we pass when we pass biodefense what happen is let's say this is function it contains an AI

411
00:26:03,250 --> 00:26:04,640
and there then type is in danger.

412
00:26:04,930 --> 00:26:09,600
So there is some code here and let's say I'm calling from the mean.

413
00:26:11,310 --> 00:26:17,890
And let's say this is I have and geez one and I am passing G.

414
00:26:18,020 --> 00:26:19,360
So what will happen.

415
00:26:19,490 --> 00:26:20,900
This is biodefense.

416
00:26:21,110 --> 00:26:27,020
So I N G boathouse him the boat contains one so the new copy will not be created.

417
00:26:27,020 --> 00:26:27,430
Okay J.

418
00:26:27,470 --> 00:26:28,480
Points towards this.

419
00:26:28,490 --> 00:26:29,970
And I also points toward this.

420
00:26:30,230 --> 00:26:40,720
So whenever we re done by defense if it will done by reference then then we will reach the mean a temporary

421
00:26:40,720 --> 00:26:42,930
memory will not be created.

422
00:26:42,940 --> 00:26:49,290
Okay so their temporary memory will point towards the memory which is inside this function.

423
00:26:49,530 --> 00:26:58,290
Okay so we have to pass by it a fence here what we have to do we have to pass by a reference okay.

424
00:26:58,300 --> 00:27:06,030
So now let's send this file and now when we'll run this file in front of the empty bottle you contain

425
00:27:06,020 --> 00:27:07,300
the value 7 by 1

426
00:27:10,420 --> 00:27:14,260
so see this time both contains the value 7 by 1.

427
00:27:14,260 --> 00:27:15,940
So now our code is working.

428
00:27:15,970 --> 00:27:16,270
Okay.

429
00:27:16,300 --> 00:27:26,710
So let us try to understand one last time so we are doing plus plus plus plus F1 okay.

430
00:27:26,790 --> 00:27:35,620
So let's say the address of F1 is 700 so numerator and denominator so that address is seven hundred

431
00:27:35,620 --> 00:27:37,730
and the values ten by two.

432
00:27:37,750 --> 00:27:38,980
So this will contain

433
00:27:41,870 --> 00:27:45,860
700 so it will become to by 2.

434
00:27:45,860 --> 00:27:51,890
After calling the simplified function it will become 6 by 1 then we are returning biodefense since we

435
00:27:51,890 --> 00:27:58,400
are returning biodefense the system before it will point towards here it will not create a separate

436
00:27:58,400 --> 00:28:02,190
memory system before it will point towards this only.

437
00:28:02,720 --> 00:28:05,790
Okay then we are agreeing calling plus plus.

438
00:28:05,810 --> 00:28:09,290
So this time this plus place will get called land system buffer.

439
00:28:09,830 --> 00:28:12,150
So this plus place will get called land system buffer.

440
00:28:12,170 --> 00:28:14,780
Now system the forest pointing towards this.

441
00:28:14,780 --> 00:28:19,170
So ultimately this plus place will be called on this only.

442
00:28:19,220 --> 00:28:21,890
So now the value will become so.

443
00:28:21,890 --> 00:28:31,830
This contains this again contains 700 now the value was 6 by 1 Okay so this is 700.

444
00:28:31,860 --> 00:28:33,990
So this contains 700.

445
00:28:33,990 --> 00:28:36,650
Now it will become 7 by 1.

446
00:28:36,900 --> 00:28:42,260
After calling after the addition and calling the simplify function then we will then we will done by

447
00:28:42,310 --> 00:28:46,010
biodefense since we are attending biodefense.

448
00:28:46,170 --> 00:28:51,930
So the system before will point towards this and then this value will get copied into fiction entry.

449
00:28:52,020 --> 00:28:55,350
Okay so F3 and F1 both contains the same value.

450
00:28:55,650 --> 00:29:01,860
Okay so that inbuilt plus plus the inbuilt plus plus that being element operator works like this only.

451
00:29:01,860 --> 00:29:04,490
Okay then build operator works like this only.

452
00:29:04,560 --> 00:29:07,410
So initially what was happening but was our mistake.

453
00:29:07,410 --> 00:29:10,790
So this plus plus we know this plus this will work on the system before.

454
00:29:10,830 --> 00:29:11,620
This is for sure.

455
00:29:12,150 --> 00:29:18,220
So initially I only what was happening this system before it was pointing towards a copy.

456
00:29:18,570 --> 00:29:23,580
Our temporary memory visual which was containing the value six by one but this damage to our bus was

457
00:29:23,580 --> 00:29:23,960
different.

458
00:29:23,970 --> 00:29:24,830
Let's say 800.

459
00:29:25,230 --> 00:29:29,670
So I deleted the system before it was pointing towards a copy.

460
00:29:29,760 --> 00:29:30,260
Okay.

461
00:29:30,330 --> 00:29:37,010
And plus plus was working on system before and system the firewall is pointing towards this.

462
00:29:37,020 --> 00:29:41,100
So that's why this value will become 7 by 1.

463
00:29:41,130 --> 00:29:45,260
And this will literally get copied into F3 and F1 remains 6 by 1.

464
00:29:45,270 --> 00:29:51,300
Now what we did is we passed my defense so this copy is not created and the system buffer will point

465
00:29:51,510 --> 00:29:54,440
towards 6 by 1 only at the 7 and 8 only.

466
00:29:54,480 --> 00:29:57,260
And plus this will work on this 700.

467
00:29:57,740 --> 00:29:58,020
Okay.

468
00:29:58,050 --> 00:29:59,220
So that's how this work.

469
00:30:00,150 --> 00:30:05,630
Okay so they invoked incremental data works like this only inheritance biodefense.

470
00:30:05,640 --> 00:30:11,670
Okay so in this way we can do as many levels of nesting as we want and it will work properly.

471
00:30:11,670 --> 00:30:12,640
Okay.

472
00:30:13,260 --> 00:30:18,220
Now the lasting can we make this function a constraint function.

473
00:30:18,300 --> 00:30:20,460
So what is our definition of a constraint function.

474
00:30:20,580 --> 00:30:25,140
A constant function is the one which will not change the properties of the current object since it is

475
00:30:25,140 --> 00:30:26,100
changing the numerator.

476
00:30:26,370 --> 00:30:29,520
So this function does not qualify for a constraint function.

477
00:30:29,940 --> 00:30:36,140
Okay so in this way you'll be all loaded up with increment operator and like this was a little bit complicated.

478
00:30:36,390 --> 00:30:39,380
Okay so what did a little complication is always fine.

479
00:30:39,480 --> 00:30:41,050
So I hope you understood this we.

480
00:30:41,460 --> 00:30:42,380
Okay.

481
00:30:42,390 --> 00:30:42,810
Thank you.
