1
00:00:01,540 --> 00:00:02,200
Hi everyone.

2
00:00:02,200 --> 00:00:06,720
So in this video we are going to on some inbuilt functions of.

3
00:00:06,760 --> 00:00:12,040
But Eddie So the first function that we will look to to start to use the land function.

4
00:00:12,040 --> 00:00:17,440
So if you remember we have already implemented our own land function but this is already present in

5
00:00:17,980 --> 00:00:21,460
C++ so the name of the function is string land.

6
00:00:21,460 --> 00:00:22,800
This function is inverted.

7
00:00:22,870 --> 00:00:25,960
So what this tingling function will take it will take.

8
00:00:25,960 --> 00:00:28,140
String name as input order against it.

9
00:00:28,140 --> 00:00:29,000
Correct Barry.

10
00:00:29,110 --> 00:00:31,000
The name with the correct bit at is input.

11
00:00:31,060 --> 00:00:32,500
So if you would read like this.

12
00:00:32,530 --> 00:00:33,700
So let us create.

13
00:00:33,850 --> 00:00:37,930
So this is character I'm creating a character input.

14
00:00:37,970 --> 00:00:46,170
Eddie let's say the size is HUNDRED AND IF YOU WERE dig the input now you will call this function string

15
00:00:46,170 --> 00:00:46,500
land.

16
00:00:46,770 --> 00:00:48,180
So how do we call this function.

17
00:00:48,210 --> 00:00:51,300
So let us with the answer inevitable.

18
00:00:51,300 --> 00:00:58,440
I wouldn't call the function string linked and I will give input as parameter and then you can print

19
00:00:59,080 --> 00:01:02,160
the land very simple.

20
00:01:02,250 --> 00:01:04,680
So let us write the code but one thing.

21
00:01:04,680 --> 00:01:09,330
So before writing the code this string length function is actually implemented in our head to file and

22
00:01:09,330 --> 00:01:11,760
the name of the head the file is C string.

23
00:01:11,940 --> 00:01:15,610
So if you want to use this function you have to include this defined.

24
00:01:15,720 --> 00:01:17,250
So let's write the code no

25
00:01:20,440 --> 00:01:26,290
so all the functions that we are going to discuss in this video I'd actually present in C string had

26
00:01:26,290 --> 00:01:31,340
to fight so C string.

27
00:01:31,400 --> 00:01:38,270
Now let us create our first arrays so string when little size is entered.

28
00:01:38,280 --> 00:01:47,590
I will take input from they use it string one and let us call the function so I will the answer inevitable

29
00:01:47,590 --> 00:01:58,930
lent the name of the function is SDR LDA in SDR alien string land and I will give a string one as input.

30
00:01:58,930 --> 00:02:05,600
And now let us try to bring Deland so let's run our program

31
00:02:10,970 --> 00:02:15,660
so net to the string is hello and you can see the output is 5.

32
00:02:15,660 --> 00:02:19,240
So let us also print land here.

33
00:02:19,250 --> 00:02:19,600
So

34
00:02:32,470 --> 00:02:38,190
now again let's turn our program and let's say this time my input is ABC.

35
00:02:38,200 --> 00:02:43,020
So the land is full and we have to it in the quarter for the land function.

36
00:02:43,020 --> 00:02:46,130
So how this in built land function will work.

37
00:02:46,170 --> 00:02:50,400
So this and world function will do the exact same thing that we were doing for example if your string

38
00:02:50,400 --> 00:02:53,060
is a b c d and obviously a little present.

39
00:02:53,070 --> 00:02:59,060
So this string then function it will just do the same thing as we did in our function.

40
00:02:59,070 --> 00:03:04,890
It will start from me then B then C then D and medical regional it will stop and it will write down

41
00:03:04,890 --> 00:03:05,920
the land which is full.

42
00:03:06,600 --> 00:03:12,500
So exactly the same code that we have written in order to see these second inbuilt function.

43
00:03:12,510 --> 00:03:18,060
So the second invalid function it this used to compare two strings.

44
00:03:18,150 --> 00:03:23,460
So given two strings and you have to check whether the two strings are equal on article.

45
00:03:23,460 --> 00:03:31,470
So the inbuilt function the need of the inbuilt function is string compared SDR C MP string compare

46
00:03:31,740 --> 00:03:34,000
and it will take two strings as input.

47
00:03:35,190 --> 00:03:37,510
Obviously it has two big two strings to compare it.

48
00:03:37,530 --> 00:03:41,930
So it will take string one and it will take a strings to string two.

49
00:03:41,970 --> 00:03:44,170
Now it will not return a boolean value.

50
00:03:44,340 --> 00:03:50,940
Basically it will return a zero or a non-zero value and zero non-zero.

51
00:03:51,090 --> 00:03:56,130
So if it is returning zero so that means the might do strings are equal.

52
00:03:56,160 --> 00:03:58,490
And if it isn't attending a non zero value.

53
00:03:58,500 --> 00:04:05,680
So this is non-zero so it will return do things that it will return a zero value or a non-zero value

54
00:04:05,770 --> 00:04:06,730
if it is returning 0.

55
00:04:06,720 --> 00:04:11,560
That means my two strings are equal and if it is returning non-zero value that means that two strings

56
00:04:11,560 --> 00:04:15,590
are not equal simple.

57
00:04:15,610 --> 00:04:24,510
So let us write the code and let's see let's see in action to test coming down these two lines

58
00:04:29,610 --> 00:04:38,840
so create an idea at a string to size is rendered and let us take both the strings and put so string

59
00:04:38,870 --> 00:04:48,610
wants to do so I will call the function string compared I will give first string I will pass second

60
00:04:48,610 --> 00:04:53,540
string so if this function is returning visible net means that those things are equal.

61
00:04:53,650 --> 00:04:57,430
So if the two strings that equal I can print equal

62
00:05:00,380 --> 00:05:02,510
in the old part I can print an article

63
00:05:12,820 --> 00:05:15,670
and now we will run our program there does desktop program

64
00:05:18,650 --> 00:05:23,000
so let's say the first string is hello and second string is also Hello.

65
00:05:23,420 --> 00:05:24,750
So both those things are equal.

66
00:05:24,770 --> 00:05:27,590
So that's why equal is getting printed.

67
00:05:27,620 --> 00:05:28,870
I just tested one more time.

68
00:05:29,150 --> 00:05:30,910
So the first a string is ABC.

69
00:05:30,980 --> 00:05:33,010
And the second string is ABC.

70
00:05:33,110 --> 00:05:34,380
So they are not equal.

71
00:05:34,400 --> 00:05:36,820
ABC and they really are not equal.

72
00:05:36,980 --> 00:05:38,510
So let's test it one more time.

73
00:05:40,190 --> 00:05:43,450
So first string is ABC second string is ACB.

74
00:05:43,640 --> 00:05:45,500
Again these two things are not equal.

75
00:05:45,500 --> 00:05:51,790
So that's why the output is coming out do we not equal so how does that string compare function will

76
00:05:51,790 --> 00:05:52,170
work.

77
00:05:52,200 --> 00:05:54,030
Let us try to learn.

78
00:05:54,250 --> 00:06:00,850
So this stink compared function actually takes boosting that input so what it will do so let's say this

79
00:06:00,850 --> 00:06:10,330
is my string when and this is my string to so let's say my string when is ABC and obviously then and

80
00:06:10,330 --> 00:06:12,900
the second string is ABC and obviously nil.

81
00:06:13,120 --> 00:06:16,060
So in this case in this case the board the strings are equal.

82
00:06:16,060 --> 00:06:18,970
So my output will be equal and it will have done zero.

83
00:06:19,000 --> 00:06:19,930
Let's see how we're doing.

84
00:06:19,990 --> 00:06:22,340
Let's see how it will be done zero.

85
00:06:22,390 --> 00:06:26,380
So what it will do it will reduce a practice or so protect it from me.

86
00:06:26,380 --> 00:06:27,560
So a minus a.

87
00:06:27,580 --> 00:06:28,630
So these are correct.

88
00:06:28,660 --> 00:06:32,670
So and we know whenever you are doing character minus character.

89
00:06:32,860 --> 00:06:35,020
So this is nothing but in Deja minus Deja.

90
00:06:35,050 --> 00:06:36,960
So that character available will be converted to it.

91
00:06:36,970 --> 00:06:37,390
Ask.

92
00:06:37,400 --> 00:06:41,320
And so basically I am doing ninety seven minus nine defendants output will be zero.

93
00:06:41,470 --> 00:06:42,570
Then we will compare.

94
00:06:42,580 --> 00:06:44,750
We will have practice these two characters.

95
00:06:44,920 --> 00:06:48,720
So B minus B again zero and then the total character.

96
00:06:48,760 --> 00:06:53,890
So basically C minus C again zero so we are getting zeros at all the time.

97
00:06:53,890 --> 00:06:56,190
So that's why this function will return zero.

98
00:06:56,290 --> 00:07:00,660
And if this is it are done in zero that means all the characters are equal in the given string.

99
00:07:00,910 --> 00:07:01,630
Perfect.

100
00:07:01,630 --> 00:07:11,540
Now let us consider a case of non zero not equal so let's say my first string string 1 is actually ABC

101
00:07:12,650 --> 00:07:17,280
and string 2 is actually ACB.

102
00:07:17,430 --> 00:07:18,950
Now these two things are not equal.

103
00:07:18,960 --> 00:07:23,540
So let's see what our function will return what I was doing some bear function will return.

104
00:07:23,700 --> 00:07:29,000
So subtract a minus C so e might NSA 90000 minus 97 0.

105
00:07:29,100 --> 00:07:32,860
Then subtract B from C so B minus C.

106
00:07:32,910 --> 00:07:33,590
Now what does this.

107
00:07:33,600 --> 00:07:38,270
This is ninety eight and this is ninety nine so you will get minus one.

108
00:07:38,310 --> 00:07:43,470
So as soon as you get the value which is different from zero basically as soon as you get a non-zero

109
00:07:43,470 --> 00:07:46,770
value then dusting combat function will are done that value.

110
00:07:46,890 --> 00:07:52,080
So in this case stink compare function will return minus 1 and if it isn't attending a non-zero value

111
00:07:52,080 --> 00:07:58,920
that means these two strings the given two strings are not equal so that is the working off string compare

112
00:07:58,920 --> 00:08:03,580
function now can you implement string compare function yourself.

113
00:08:03,580 --> 00:08:05,440
Yes definitely we can.

114
00:08:05,500 --> 00:08:12,310
What we have to do is 1.0 at this position take one at this position compared both of them and move

115
00:08:12,310 --> 00:08:14,870
ahead as soon as that if you encounter.

116
00:08:15,220 --> 00:08:17,860
If you find out that the elements are different you will stop.

117
00:08:17,860 --> 00:08:19,860
So basically I am writing the pseudo code for you.

118
00:08:19,860 --> 00:08:23,900
You can definitely coded for yourself but you can do so.

119
00:08:23,920 --> 00:08:28,480
Let us take a variable i equals zero.

120
00:08:28,480 --> 00:08:30,710
So I am taking a variable life for same.

121
00:08:30,790 --> 00:08:34,450
So basically first you can check what you can do.

122
00:08:34,450 --> 00:08:37,200
So let me implement these things combined function for yourself.

123
00:08:38,200 --> 00:08:44,520
So I am implementing string combat function for you so that they will be the C V.

124
00:08:44,660 --> 00:08:46,470
We are implementing the function to

125
00:08:49,330 --> 00:08:56,170
there's sure to be a K so I am implementing a string compare function differently.

126
00:08:56,300 --> 00:09:00,770
So might might return David rebellion but there are two strings that equal or not.

127
00:09:00,770 --> 00:09:06,020
And let's say string compared on.

128
00:09:06,030 --> 00:09:08,360
So this is OK so let's name it.

129
00:09:08,360 --> 00:09:14,470
My and compare my string compare what it will take it will take boosting Z input.

130
00:09:14,890 --> 00:09:22,280
So this is String String 1 and the second string will be

131
00:09:25,350 --> 00:09:31,230
string 2 but you have to do you have to just do data and check whether they are equal or not.

132
00:09:31,260 --> 00:09:39,460
So first of all let us find our dear land so if what is the function of finding the land is the alien.

133
00:09:39,520 --> 00:09:41,150
So if their lands are different.

134
00:09:41,350 --> 00:09:44,980
If string my land is not close to the land of

135
00:09:48,240 --> 00:09:50,540
if their lands are different that means they are not equal.

136
00:09:50,550 --> 00:09:55,240
So you can detect leader down faults from here correct.

137
00:09:55,510 --> 00:09:58,580
Now what you have to do you have to compare each and every correct.

138
00:09:58,610 --> 00:10:02,090
So if we're comparing each and every character I just need to iterate.

139
00:10:02,090 --> 00:10:03,890
So there are two ways of hydrating first.

140
00:10:03,890 --> 00:10:05,360
You can write like this.

141
00:10:05,390 --> 00:10:09,350
I's listing SDR alien of string when

142
00:10:12,410 --> 00:10:16,260
and a listless so compared the I yet corrected.

143
00:10:16,260 --> 00:10:28,360
So if the I yet get a bit of string when is not equal to the I yet corrected often string to so you

144
00:10:28,360 --> 00:10:35,280
can read unfolds and finally you can pretend to connect.

145
00:10:35,290 --> 00:10:37,220
So this is the first to be rating.

146
00:10:37,330 --> 00:10:39,970
So let us check our program so I will call the function

147
00:10:42,780 --> 00:10:45,170
so let's let's combine this.

148
00:10:45,210 --> 00:10:54,490
Let's copy this.

149
00:10:54,520 --> 00:10:57,070
So this is my string compared.

150
00:10:57,280 --> 00:11:00,490
I will pass two strings string when answering do so.

151
00:11:00,560 --> 00:11:05,670
This milestone can sting combat function is going to call this function and then type is a billion.

152
00:11:05,710 --> 00:11:11,620
So let us test our program so the first string is hello.

153
00:11:11,770 --> 00:11:15,860
Second string is also hello and the output is in the article.

154
00:11:16,090 --> 00:11:19,000
Let us tested one more time for nautical keys.

155
00:11:19,270 --> 00:11:28,440
So if my first string is left to ABC and sorry this is BSE and the second string is b c so they are

156
00:11:28,510 --> 00:11:29,050
nautical

157
00:11:32,540 --> 00:11:38,240
and the second off dating basically instead of using string meant function we seen the last radio we

158
00:11:38,240 --> 00:11:39,340
can use and that is correct.

159
00:11:39,360 --> 00:11:44,120
So what can I do I can write like this.

160
00:11:44,190 --> 00:11:55,190
So this is basically a string when string of a So this is string when I get corrected is not equal to

161
00:11:56,660 --> 00:11:57,770
Dean native character

162
00:12:01,930 --> 00:12:03,970
so there are two ways of treating.

163
00:12:04,040 --> 00:12:06,160
So this one and the previous one.

164
00:12:06,190 --> 00:12:07,720
So let's test this one also

165
00:12:12,660 --> 00:12:13,590
first thing is hello.

166
00:12:13,590 --> 00:12:14,890
Second string is also Hello.

167
00:12:14,910 --> 00:12:24,580
They are equal now the first string is let's say a b c d and second string is e only so they are not

168
00:12:24,580 --> 00:12:31,120
equal.

169
00:12:31,140 --> 00:12:34,510
So what I'm doing in this function.

170
00:12:34,620 --> 00:12:38,400
So first of all I am digging through strings of input then I am finding out their length.

171
00:12:38,430 --> 00:12:43,410
So if there lends an article definitely David in order to be close so I can then likely false from it

172
00:12:43,950 --> 00:12:45,190
that I use for today and I do so.

173
00:12:45,330 --> 00:12:49,370
One thing is very clear at this point both the strings have the same blend.

174
00:12:49,530 --> 00:12:53,090
So the first testing is a BCG and the second string is ABC.

175
00:12:53,100 --> 00:12:56,060
If then what will happen.

176
00:12:56,060 --> 00:12:56,830
Yeah.

177
00:12:57,100 --> 00:12:58,120
I will start from zero.

178
00:12:58,120 --> 00:13:01,230
So this is I and I will move in this direction.

179
00:13:01,300 --> 00:13:01,740
Simple.

180
00:13:01,750 --> 00:13:06,910
You are competing guy you are trusting one with the iconic posting to compete everyday they adequately

181
00:13:06,970 --> 00:13:11,580
move ahead to compare B to be dead equal move where to compare C would see that equal move ahead.

182
00:13:11,680 --> 00:13:14,250
Now compare David F so they are not equal.

183
00:13:14,320 --> 00:13:19,750
So as soon as they are not equal you will it unfolds and suppose if this is D.

184
00:13:19,750 --> 00:13:27,590
So what will happen this condition will become false and all just all decided equal so you will return.

185
00:13:27,720 --> 00:13:32,340
So that's how this is working and there are two ways of doing things so the first one the previous one

186
00:13:32,350 --> 00:13:37,410
was very simple just like we used to doing at a equals you do a list and end it a plus plus and what

187
00:13:37,410 --> 00:13:44,420
is n and is actually these string lent off string when you can write string two because they have the

188
00:13:44,420 --> 00:13:45,650
same blend.

189
00:13:45,890 --> 00:13:52,240
So this was the previous one code that we have written and the second one is using the null corrector

190
00:13:52,280 --> 00:13:52,760
approach.

191
00:13:53,720 --> 00:13:56,920
So there are two ways of writing you can choose anyone.

192
00:13:56,960 --> 00:14:02,000
Now one thing that I want to clear here is basically that I am returning bool but the actual string

193
00:14:02,000 --> 00:14:03,030
compare function.

194
00:14:03,530 --> 00:14:10,680
I told you so it will return a zero value or a non-zero value so it's working is different and I hope

195
00:14:10,680 --> 00:14:17,220
you can definitely implement the code for the inbuilt string combat function for yourself it is going

196
00:14:17,220 --> 00:14:19,060
to be very very easy.

197
00:14:19,770 --> 00:14:20,870
You just have to return.

198
00:14:20,910 --> 00:14:24,990
So instead of boolean what you will do you just will change the return type.

199
00:14:24,990 --> 00:14:29,820
So instead of returning false you cannot write this statement because you have to do DNA in digital

200
00:14:29,820 --> 00:14:33,630
value so let's make it bool here.

201
00:14:33,900 --> 00:14:42,170
So consider it as an exercise try to write the code for the inbuilt string compare function.

202
00:14:42,210 --> 00:14:47,640
So now let us see the third and build function so we have seen lend function we have seen compared boosting

203
00:14:47,640 --> 00:14:48,740
function.

204
00:14:48,780 --> 00:14:53,100
Now the third function is actually copy string function.

205
00:14:53,100 --> 00:14:59,790
So this is also in function but we have to do we have to copy one string into another string so the

206
00:14:59,790 --> 00:15:04,020
name of the function is actually string copy.

207
00:15:04,020 --> 00:15:09,610
So this is string S.B. VI SDR sleepy VI string copy function.

208
00:15:09,730 --> 00:15:11,190
It will take boosting as input.

209
00:15:11,190 --> 00:15:19,830
So first one is the destination string and the second one is actually solves the string and what is

210
00:15:19,830 --> 00:15:20,730
the difference.

211
00:15:20,730 --> 00:15:22,820
So what will happen.

212
00:15:22,860 --> 00:15:29,090
So the content of the source of string would get copied into my destination string for example.

213
00:15:29,280 --> 00:15:33,490
This is the first listing hello and this is your second string.

214
00:15:33,520 --> 00:15:38,120
So in order to copy the content of a and b you can use this functions don't copy.

215
00:15:38,130 --> 00:15:48,550
So you will write like this string copy copy the content of a in dooby simple copy the content of a

216
00:15:48,560 --> 00:15:51,420
and b for example.

217
00:15:51,430 --> 00:15:52,710
This is you listing A's.

218
00:15:52,720 --> 00:15:54,720
Let's say this is correct Betty.

219
00:15:54,790 --> 00:15:56,190
So this is easier and better.

220
00:15:56,200 --> 00:16:01,620
And the string is ABC B's or so bad and the string is the E F.

221
00:16:01,630 --> 00:16:08,210
So if you wouldn't call the function string copy if you look right back on my e or if you write a comma

222
00:16:08,240 --> 00:16:09,430
B then what will happen.

223
00:16:09,620 --> 00:16:11,880
The content of B will get copied inside.

224
00:16:12,170 --> 00:16:14,390
So the B content of being will get copied.

225
00:16:14,420 --> 00:16:21,970
So instead of ABC it will become the F and if you were trying to print the value of a.

226
00:16:22,510 --> 00:16:26,520
So the value of A's actually the F no do not take my words.

227
00:16:26,530 --> 00:16:36,580
So let us best have a called so we need two strings and let us initialize those two things.

228
00:16:36,580 --> 00:16:38,700
So the first string instead of taking input.

229
00:16:38,740 --> 00:16:40,040
Let us give the value here on the.

230
00:16:40,060 --> 00:16:41,590
So the first thing is a basically

231
00:16:44,920 --> 00:16:49,660
and the second string is actually that's called the F first is ABC.

232
00:16:49,660 --> 00:16:53,720
The second is the F so I am not taking in anymore.

233
00:16:55,700 --> 00:17:00,000
And so this is this comment.

234
00:17:00,020 --> 00:17:06,090
This also.

235
00:17:06,150 --> 00:17:09,020
So what do we wanted.

236
00:17:09,060 --> 00:17:11,010
So I want to call the function string copy.

237
00:17:11,010 --> 00:17:17,340
So first let us Sprint devalue before copy and we will print devalue after copying.

238
00:17:17,340 --> 00:17:19,590
So before.

239
00:17:19,800 --> 00:17:28,480
So what are the values we photocopying see out string when and let us also print string to

240
00:17:41,970 --> 00:17:49,010
so I am printing string witnessing to be photocopy and we will also print after a copy.

241
00:17:49,140 --> 00:17:55,600
So this is after a copy and here I will call the function string copying.

242
00:17:55,620 --> 00:17:59,500
So SDR S.B. VI string copying first.

243
00:17:59,520 --> 00:18:03,870
So what I want to do I want to copy the content of string to interesting one.

244
00:18:03,930 --> 00:18:07,430
So first you have to write the destination string then.

245
00:18:07,860 --> 00:18:08,140
Okay.

246
00:18:08,150 --> 00:18:11,470
So I want to copy the content of string two into one.

247
00:18:11,470 --> 00:18:17,720
So this is string to copy the content of string to and string one.

248
00:18:17,780 --> 00:18:25,000
So let's see.

249
00:18:25,080 --> 00:18:29,540
So this is before copy the content of a string when is ABC.

250
00:18:29,610 --> 00:18:35,340
Now see after copying the content of string when changed to the F and the content of string to remains

251
00:18:35,340 --> 00:18:36,400
the same.

252
00:18:36,570 --> 00:18:41,460
Obviously the content of string will remain same because we are copying the content of string to undo

253
00:18:41,460 --> 00:18:42,000
string one.

254
00:18:42,000 --> 00:18:44,220
So string one was initially ABC.

255
00:18:44,250 --> 00:18:49,440
Now it is the F.

256
00:18:49,510 --> 00:18:58,380
So now let's try to understand how the in built a string copy function books.

257
00:18:58,400 --> 00:19:11,370
So basically what I did here so my first instinct was so my string one it was actually ABC and what

258
00:19:11,370 --> 00:19:12,450
was a string two.

259
00:19:12,450 --> 00:19:18,780
So this was the F then I'm copying the content of a string to do string one.

260
00:19:18,810 --> 00:19:19,620
So what will happen.

261
00:19:19,980 --> 00:19:21,620
So the E F will get copied.

262
00:19:21,630 --> 00:19:28,670
So the e f or the E F will come here and also so there is no character here also and here also.

263
00:19:28,680 --> 00:19:30,660
So what this string copy function will do.

264
00:19:30,660 --> 00:19:32,400
It will copy the null character also.

265
00:19:32,400 --> 00:19:37,090
So instead of the instead of the usual right null so that's why.

266
00:19:37,380 --> 00:19:39,310
What is the content of string when now.

267
00:19:39,360 --> 00:19:43,220
So it is containing the E F then then and then.

268
00:19:44,370 --> 00:19:48,880
So then you will call the function c out it alone LeBron.

269
00:19:48,930 --> 00:19:52,010
D take it because it will encounter no light at this point.

270
00:19:52,010 --> 00:19:57,530
So one thing to remember that string copy function so this listing can be function.

271
00:19:57,530 --> 00:20:03,400
Also copy none so it will also copy detailed character.

272
00:20:03,750 --> 00:20:05,860
This one character.

273
00:20:06,090 --> 00:20:12,650
Okay so this is important thing to remember for distinct copy function so if I will write like this

274
00:20:12,800 --> 00:20:19,090
string copy letters string 1 and I want to copy.

275
00:20:19,090 --> 00:20:19,990
Hello.

276
00:20:19,990 --> 00:20:22,100
So I can also do this.

277
00:20:22,300 --> 00:20:23,080
What will happen.

278
00:20:23,080 --> 00:20:25,360
Hello will get copied and do string 1.

279
00:20:25,480 --> 00:20:30,670
So let's see so instead of string 2 you can write Hello.

280
00:20:30,760 --> 00:20:32,320
So you can give a string here also.

281
00:20:33,010 --> 00:20:34,450
So now let us start program

282
00:20:39,260 --> 00:20:42,200
so you can see string 1 was initially ABC.

283
00:20:42,240 --> 00:20:43,490
Now it is hello.

284
00:20:43,640 --> 00:20:48,710
And obviously I didn't do anything with strings do so string two is remaining same.

285
00:20:48,710 --> 00:20:50,270
Now how it is working.

286
00:20:50,270 --> 00:20:52,450
So basically again the string copy function.

287
00:20:52,460 --> 00:20:53,450
What it will do.

288
00:20:53,450 --> 00:21:00,830
So first of all it will copy the content of Halo so string 1 was actually DCF.

289
00:21:01,780 --> 00:21:06,410
So it is string when was actually containing ABC.

290
00:21:07,400 --> 00:21:09,190
And then so it will happen.

291
00:21:09,200 --> 00:21:11,860
Halo will get copied and also the note is.

292
00:21:11,960 --> 00:21:12,930
So here do it.

293
00:21:12,950 --> 00:21:19,910
What will happen so remove this one etch e n and all and this string complete string copy function it

294
00:21:19,910 --> 00:21:22,120
will put the null connector by itself.

295
00:21:22,250 --> 00:21:27,740
So this is not correct that will get automatically inserted will automatically appended by the string

296
00:21:27,740 --> 00:21:29,570
copy function.

297
00:21:29,750 --> 00:21:35,480
So the question is can you implement string copy function yourself so can you implement string copy

298
00:21:35,480 --> 00:21:36,490
function yourself.

299
00:21:36,490 --> 00:21:39,440
I am giving you the idea and take it as a homework.

300
00:21:39,440 --> 00:21:41,470
You can definitely implemented for example.

301
00:21:42,560 --> 00:21:46,540
So let's take one example and I will give you the idea.

302
00:21:46,850 --> 00:21:48,560
For example this is string 1.

303
00:21:48,560 --> 00:21:56,300
So what is string when ABC and what is a string to let's call it D.

304
00:21:56,310 --> 00:22:03,070
If so what you will do you will take one point here and you will just I don't know what this string

305
00:22:03,550 --> 00:22:05,510
so you will do something like this.

306
00:22:05,590 --> 00:22:11,950
What is string so it is distinguished so string when I get corrected it is nothing it is just equal

307
00:22:11,950 --> 00:22:14,490
to string to I get corrected.

308
00:22:14,980 --> 00:22:20,830
So I am trying to copy the content of string to interesting Gwen so you will just irate over the string

309
00:22:20,830 --> 00:22:23,430
too and you will copy the content.

310
00:22:23,650 --> 00:22:28,720
So just remember you have to also copy the null corrected so they will get copied.

311
00:22:28,750 --> 00:22:29,950
Then even get copied.

312
00:22:29,980 --> 00:22:33,100
Then F will get copied and then corrected will get copied.

313
00:22:33,100 --> 00:22:36,270
Simple very simple.

314
00:22:36,330 --> 00:22:38,650
So your for loop what it will look like this.

315
00:22:38,850 --> 00:22:43,800
You are trying to hide data with a string too so you will write like this equals zero i.e. less than

316
00:22:43,830 --> 00:22:47,000
I did close to N and I bless bless.

317
00:22:47,010 --> 00:22:52,390
So remember that inbuilt string copy function it copy the note corrected also.

318
00:22:52,390 --> 00:22:55,730
So you have to copy the null connector that's way less than articles 2.

319
00:22:55,750 --> 00:23:06,180
So what is n and this string lint off string to so you can definitely implement this code by yourself.

320
00:23:06,220 --> 00:23:08,400
I am living this task to you.

321
00:23:08,830 --> 00:23:12,250
So we have seen t functions till now.

322
00:23:12,310 --> 00:23:13,810
So first one was the Lent function.

323
00:23:13,810 --> 00:23:19,540
Second is compared to string function and the third one is actually copy strings hosting copy function.

324
00:23:19,540 --> 00:23:28,550
Now let's see the fourth function so the fourth function is string and copy.

325
00:23:28,830 --> 00:23:31,160
You want to copy the first and correct us.

326
00:23:31,230 --> 00:23:37,170
So this is basically you want to copy these first and corrected off one string and do another string

327
00:23:37,200 --> 00:23:40,070
so copy first and correct us.

328
00:23:40,080 --> 00:23:41,760
So in the above function so what.

329
00:23:41,760 --> 00:23:49,230
String copy will do string copy it will take to string string when answering to and it will copy the

330
00:23:49,230 --> 00:23:53,990
whole string to undo string one and string do will not be affected.

331
00:23:54,030 --> 00:24:01,410
So this this string copy function it copied the whole string but string and copy will copy only the

332
00:24:01,410 --> 00:24:02,820
first and correct both.

333
00:24:02,850 --> 00:24:04,620
So this is not copy this is the character.

334
00:24:04,950 --> 00:24:08,980
So it will only copy these first and characters simple.

335
00:24:09,030 --> 00:24:13,570
So for example my string Len is okay.

336
00:24:13,580 --> 00:24:14,650
So what do we this index.

337
00:24:14,660 --> 00:24:23,470
So you will write like this string and copy you will give the destination string then you will give

338
00:24:23,500 --> 00:24:31,600
the source string and then you will give how many characters you want to copy first and correct this

339
00:24:31,600 --> 00:24:32,770
will get copied.

340
00:24:32,770 --> 00:24:40,840
For example if a string one is a b c d e and let us handle and what is your string to so the string

341
00:24:40,840 --> 00:24:44,440
to is let's say hello and then obviously then.

342
00:24:44,760 --> 00:24:48,390
So what will happen if I call the function string and copy.

343
00:24:48,390 --> 00:24:55,710
I will give a string when I will give string to and let's say I want to copy first three characters.

344
00:24:55,720 --> 00:25:02,470
So h e l will get copied so we remove these t characters and h e l will come here.

345
00:25:02,470 --> 00:25:10,840
Now one thing to notice here is string and copy it will not copy the initial character so it will not

346
00:25:10,840 --> 00:25:12,340
copy null character.

347
00:25:12,370 --> 00:25:18,100
So no character is not going to be copied whereas string copy function it will copy these null character

348
00:25:18,640 --> 00:25:20,430
so it copies Dean and characters.

349
00:25:21,250 --> 00:25:25,490
So that is the basic basic difference between string copy and string and copy.

350
00:25:25,540 --> 00:25:31,690
Again do not take my words we will write the code so let's make it.

351
00:25:31,900 --> 00:25:44,850
Hello and instead of a strict copy function so I will call the function string and copy C.P. VI.

352
00:25:45,030 --> 00:25:48,020
This is a string when then string do.

353
00:25:48,060 --> 00:25:52,670
And I want to copy first three characters so let's see

354
00:25:56,870 --> 00:26:00,460
so my string when was initially a b c d and string two was yellow.

355
00:26:00,500 --> 00:26:04,720
Now after copying string one becomes edgy early and distinct to his Hello.

356
00:26:04,730 --> 00:26:05,840
So why actually.

357
00:26:05,870 --> 00:26:10,230
So it is very obvious so string one was ABC.

358
00:26:10,290 --> 00:26:12,090
So this was the initial condition.

359
00:26:12,270 --> 00:26:15,110
Then you are copying the first three characters of string two.

360
00:26:15,120 --> 00:26:23,280
So what are the first three characters h e and so h e n so h e l so let's say the string one will become

361
00:26:23,310 --> 00:26:24,780
edgy in and then the.

362
00:26:24,780 --> 00:26:26,400
And obviously you have the character.

363
00:26:26,520 --> 00:26:32,600
So again the string and copy function it will not copy the name but simple.

364
00:26:32,670 --> 00:26:39,570
Now one note that you might be having in your mind is basically let's say if my first string is basically

365
00:26:40,050 --> 00:26:50,450
so for example if my first string is actually a b c d and let's say my second string is actually x ray

366
00:26:50,450 --> 00:26:57,860
only and if I call the function this one string and copy if I'm calling the function string and copy.

367
00:26:57,860 --> 00:27:06,300
So copy the content of string to interesting one and copy these first four characters but if you will

368
00:27:06,300 --> 00:27:09,510
see string to only has to correct those.

369
00:27:09,510 --> 00:27:11,310
So what will happen.

370
00:27:11,730 --> 00:27:13,370
Again it is very obvious again.

371
00:27:13,440 --> 00:27:16,180
So first two characters will get copied.

372
00:27:16,470 --> 00:27:22,290
So X will come in and virally come here but see we have to copy the four character first for character

373
00:27:22,710 --> 00:27:28,560
and obviously we have only two characters so what will happen at least two characters will become null.

374
00:27:28,590 --> 00:27:34,620
So the first two characters will get corporate X Y and the next two characters will automatically will

375
00:27:34,800 --> 00:27:38,370
be copied the next two characters that will get copied will be null.

376
00:27:38,370 --> 00:27:46,080
So instead of CMB MacLennan socially tried to print a string when the output will be excellent.

377
00:27:46,530 --> 00:27:47,220
So let's see

378
00:27:51,940 --> 00:27:59,150
so instead of yellow let's make it X X1 and as discussed the output will be.

379
00:27:59,220 --> 00:28:04,530
So I want to copy the first four characters and the string two is containing only two characters.

380
00:28:04,530 --> 00:28:10,410
So first two connect doesn't get copied X Y and the next two characters that are going to be get copied

381
00:28:10,410 --> 00:28:12,410
and actually then corrected.

382
00:28:13,020 --> 00:28:15,650
So you can see string one is X way.

383
00:28:15,780 --> 00:28:17,580
Initially it was ABC.

384
00:28:17,610 --> 00:28:19,320
So that's how it will work.

385
00:28:21,760 --> 00:28:24,340
So now let's see the lost function.

386
00:28:24,430 --> 00:28:27,880
So we have done Ford and function and are titles.

387
00:28:27,880 --> 00:28:32,520
So the first function was SDR alien.

388
00:28:32,690 --> 00:28:40,870
The second function was I think string compare and so SDL RCMP the third function was string copy as

389
00:28:40,870 --> 00:28:49,320
DCP VI and therefore its function was string and copy and now let us see the last function.

390
00:28:49,320 --> 00:28:58,220
So this is very simple string concatenate so string concatenate function but it will lose so this string

391
00:28:58,220 --> 00:29:01,100
concatenate function it will be boosting as input.

392
00:29:01,100 --> 00:29:09,050
So this is string one and this is string to so it will concatenate the content of a string to after

393
00:29:09,050 --> 00:29:09,620
string one.

394
00:29:09,620 --> 00:29:19,470
So for example if my string one is let's say ABC and if my string too is let's say the F and if you

395
00:29:19,480 --> 00:29:24,100
call this function string concatenate so string two will get appended after string 1.

396
00:29:24,220 --> 00:29:26,020
So basically leave it to the situation.

397
00:29:26,260 --> 00:29:35,930
So a string one will become C D E F so B if we get copied at the end and string two will remain same.

398
00:29:36,130 --> 00:29:38,880
Obviously we are not doing anything with string two.

399
00:29:38,990 --> 00:29:43,990
So obviously do not take my word I will just write the code and we will see it ourself

400
00:29:46,730 --> 00:29:50,360
so let's not use this function anymore.

401
00:29:51,910 --> 00:29:52,210
Okay.

402
00:29:52,220 --> 00:29:57,790
So what I want to do string concatenate so before concatenate so you NCT.

403
00:29:57,830 --> 00:30:06,580
So before one congregation and after concatenation and let us call the function string concatenate I

404
00:30:06,580 --> 00:30:13,720
will pass string one and I will pass this thing too to so copy the content of so concatenate the content

405
00:30:13,720 --> 00:30:16,670
of string to after the string when simple.

406
00:30:16,690 --> 00:30:19,420
So let's do let's run our program

407
00:30:23,480 --> 00:30:25,960
so you can see string do is remaining same.

408
00:30:25,970 --> 00:30:26,590
No changes.

409
00:30:26,600 --> 00:30:28,480
But initially the string one was a b c d.

410
00:30:28,490 --> 00:30:29,720
Now it is ABC.

411
00:30:29,750 --> 00:30:30,230
Excellent.

412
00:30:30,980 --> 00:30:37,420
So this is a b c d x y because a string 2 is now concatenated at the end of distinguished string to

413
00:30:37,430 --> 00:30:40,340
is appended at the end of string 1.

414
00:30:40,600 --> 00:30:44,000
So can you implement this string concatenated function yourself.

415
00:30:45,230 --> 00:30:47,530
Yes definitely we can merge.

416
00:30:47,540 --> 00:30:50,580
Do you have to do you just have to do basic basic thing.

417
00:30:50,600 --> 00:30:57,740
So for example this is your string when you would lose all the ABC and then you have none.

418
00:30:57,900 --> 00:31:02,970
And what is string to string do is actually the F and then you have nil.

419
00:31:03,510 --> 00:31:04,260
So what do we do.

420
00:31:04,290 --> 00:31:06,460
You will come at this point.

421
00:31:06,620 --> 00:31:10,270
So what is this point so you can take a variable let's quality.

422
00:31:10,490 --> 00:31:11,330
So what is I.

423
00:31:11,360 --> 00:31:14,350
I use nothing but string land.

424
00:31:14,510 --> 00:31:16,310
You can call the functions to England.

425
00:31:16,310 --> 00:31:19,890
You will pass a string when so will likely come at this point.

426
00:31:19,900 --> 00:31:22,610
So after coming at this point what do you will do.

427
00:31:22,610 --> 00:31:28,040
You will copy discontent dual irate with this eddy and you will copy the content so for example you

428
00:31:28,040 --> 00:31:30,290
will write like this string.

429
00:31:30,290 --> 00:31:35,430
When let's call it.

430
00:31:35,620 --> 00:31:38,140
So what I will do I will create a listing too.

431
00:31:38,200 --> 00:31:41,520
So let's call it i.e. basically.

432
00:31:41,920 --> 00:31:43,700
And let's call it.

433
00:31:43,840 --> 00:31:45,130
And so this is.

434
00:31:45,140 --> 00:31:47,520
And so what I will do I would write like this.

435
00:31:47,560 --> 00:31:59,900
String 1 8 plus n is it close to string to 8 character and obviously you add I.

436
00:32:00,280 --> 00:32:01,750
You have to copy that also.

437
00:32:01,750 --> 00:32:09,380
Okay so it will become D then E then F and then you will copy dissonant so I equals zero I less denied

438
00:32:09,390 --> 00:32:12,410
equals to so let's.

439
00:32:12,770 --> 00:32:14,180
What is the length of this string.

440
00:32:14,180 --> 00:32:17,210
So let's store it in a variable M so you will write like this.

441
00:32:17,210 --> 00:32:21,830
String length of string do you have to copy the nettle correctly also.

442
00:32:22,260 --> 00:32:24,010
So you can write like this.

443
00:32:24,150 --> 00:32:25,530
This is m.

444
00:32:25,760 --> 00:32:28,740
This is him and you will do a plus plus.

445
00:32:28,820 --> 00:32:37,740
And that's on so I think this code should work fine how it will work because you can see what they are

446
00:32:37,740 --> 00:32:38,000
doing.

447
00:32:38,000 --> 00:32:44,070
You are trading on instinct too and you have to copy the entire content of string 2 so I equals zero.

448
00:32:44,130 --> 00:32:46,130
I left an article stream I plus plus.

449
00:32:46,340 --> 00:32:51,750
So we will take this for variables and to consider it for characters into consideration.

450
00:32:51,750 --> 00:32:59,770
D E F and then and here what I am doing for string when so I am doing a plus and so I if the value of

451
00:32:59,770 --> 00:33:02,130
FY 0 you are doing I listen.

452
00:33:02,160 --> 00:33:05,900
So if you will if you will add plus 1 you will reach here.

453
00:33:06,240 --> 00:33:11,260
So B will get copied in place often and so that's how it will work.

454
00:33:11,280 --> 00:33:15,030
Or D will come here even come here and F will come here okay.

455
00:33:15,040 --> 00:33:17,300
So I think this goal should work.

456
00:33:17,320 --> 00:33:18,070
So what do you have to do.

457
00:33:18,070 --> 00:33:24,710
You have to implement all these five functions yourself so just write the implementation of all the

458
00:33:24,710 --> 00:33:31,270
five functions and from my experience I can tell you which functions are most important.

459
00:33:31,270 --> 00:33:38,030
This one only this one and you can very easily implement this function.

460
00:33:38,050 --> 00:33:41,760
We have also implemented this one string copy yes.

461
00:33:41,770 --> 00:33:48,390
This is also sometimes useful but mostly I use only these two functions string length and string copy.

462
00:33:50,070 --> 00:33:52,670
These two functions are very rarely used.

463
00:33:52,860 --> 00:33:54,150
And similarly this one also.

464
00:33:55,440 --> 00:33:59,170
So this one and this one are the most important.

465
00:33:59,310 --> 00:34:05,680
So we have already implemented this one and we have also implemented this one.

466
00:34:05,880 --> 00:34:07,590
I think you can implement the rest.

467
00:34:07,590 --> 00:34:12,840
Three of them so this will be a very good according exercise for you.

468
00:34:12,840 --> 00:34:15,460
I hope you guys can definitely do it.

469
00:34:15,720 --> 00:34:16,970
So we'll see in the next one.

470
00:34:16,980 --> 00:34:17,310
Bye bye.
