Welcome back into early session.
We learned about string copy GFC poor decision we will learn about string lint function.
Okay so let's get started.
So I'm using this almost the same program.
So Dennis it is a declaration and utilization of a string value to string one and a string two.
Okay.
Here what I'm going to do is if I suppose if I want to find the length of this particular string value
a particular missing value then can you set the string length.
OK.
This is the basic syntax.
So the string SDR element is a function which is defined as a single hitch flight.
And there should be only one parameter which you need to use for example if you want to find the length
of this variable then you can put this variable here and I suppose if you want to find the length of
string to it then you need to find that particular variable or in this particular case the basics impacts
how to use a stimulant function.
OK.
So Singleton SDR alien and in the bracket you need to set the bracket you need to mention the variable
name for which you want to find that length.
Okay so you can I'm repeating this the header of this one we already scored the sacrifice and the string
got hit I mean really get because I'm using a string function.
So this way how glad I have included so that I have included the header file here in order to so during
the execution dissing function will be invoked from this single file.
Okay.
There's something like a function call function call which is already defined in the single file.
Okay so that is a declaration and insulation where we have initialized the needs to this testing one
variable and then and centers could see it just yet a variable here what I'm going to do is I'm just
trying to find the length of this particular string.
It can be fine can be ten or it can be eleven or whatever it is.
So after the execution of this program we'll come to know the length of the string value which it has
been stored at this particular very much so.
Similarly I have one more variable is Shadow which contains this one.
So I'm just trying to find the length of this particular variable if you see here.
One two three.
String.
One two three four five six so distinguished it will have six characters.
And the second one one two three four five six seven eight.
So on second string variable it's still to have a cat.
So this should print six.
There should be six.
And this should be it.
Okay and then zero which means the signals for the normal definition C programming language and I'm
just compiling and executing C and executing.
Let's see what happens.
C As I mentioned six and eight because this string the variable the string variable has a holding character
of six values.
Is withholding the value of a character values.
Okay so this how we can use string length function C language.
Now we will jump into the string concatenation.
OK so extreme concatenation of this tool we already discussed in the earlier session.
So that we will jump here.
So this I mean program where the execution starts again.
I have the same declaration initialization here.
String concatenation what happens is think that arching concatenation can content.
It upends the value of yesteryear to read this.
This is the source and is a destination.
What are the value here.
It would append here for example if four days.
Dennis Singleton has Dennis and SJ to Richie.
So this Richie will be appended here which means at the end the output should be like this.
It should be.
Dennis Richie it just concatenated just joints.
Can Canada we can do just joints or can you do whatever the value here is here.
It'll be appended here.
So to not over here which means this value will be dead on top of it.
This value will be upended.
But make sure the space has been allocated accordingly.
OK so let me see good.
I'm just printing this one string values and this is the place holder as I told in my illustration.
So this since there's a string I'm using s OK so if it is integer we need to use it.
If I'm printing a integer value then I need to use D.
This is the string so I'm using S Ok so I'm just printing this value.
Now let's see what it shows.
C Dennis Ritchie
OK now I'm just changing the value has been gets OK.
So at the end I should get
should get Bill Gates when I'm executing the output should be Bill Gates because we are opening this
year to value to anyone.
Which means we're just joining.
OK.
Getting Bill Gates so this how stink can function works.
OK.
So we will.
Hi guys.
This tutorial we learn we will learn about string combat function
stink impasse fasting SGI RCMP function compares to strength.
And this is the basic syntax I ended that type of Deja render type in the SGA CMB and there will be
two parameters in this the first parameter and the second parameter.
Okay what happens is like when you're using using a stink about function it compares two strings to
the character if the first character of two strings are equal.
Next character of two strings are compact.
This continues until the corresponding getters characters of two strings are different ordinal at this
stage.
Okay so
if the return value from string compare is Jiro it means both strings are identical which means for
example like a frame comparing a string.
For example Dennis is tier 1 and Dennis shadow is potent which means both are equal it compares character
by character and if for this both are equal then it will return a value of zero.
So that's why we have different depths I the OK to return the value of 0.
Suppose if they ask you value of the first and mesh that is less than a second it'll return a negative
negative value.
Okay.
Is the ask you value of first and mascot is greater than second.
Then pause to integer deliberately.
Okay so take note of it.
So which means if this is if two variables values are equal then during the comparison obvious Jesse
and B it does zero.
Okay so we'll see for that with the help of a program OK we'll go line by line for the steam combat
function example.
OK.
Here this dot is Judy.
Are you on his shredder file.
We are doing this because they license this string dot here.
I have included it because we're using an inbuilt to think about function which is defined in this standard
has had profile.
So that's why I'm using this this particular profile here.
OK.
So know what I'm doing here is I have a two variable string variables instead of one this year.
Do I need stylized with the value of Dennis and Richie.
Okay.
So and I have one more very cool very will call the third where I'm just capturing the output of a out
of CMB function.
So what it does is like it it combats vote value or variable values one by one if if it if both are
identical both are equal then it value of zero then Britain will be stored to this particular variable.
Okay.
Otherwise it will be negative or positive based on the combat is actually supportive of the comparison
and doing the comparison.
If and match these formulas in a second item it is a negative value because the UN match is after more
than one second.
It happens after one second.
Then you do the a positive.
Okay.
I'm just comparing you for this is equal to zero.
This is output of distinction combat function is zero for the zero than an apparent test.
To sing one and string two are equal.
OK answer and just a random suggesting one and two are different.
Okay so many good this one this one should be printed because Dennis and Ritchie is not saying okay
but they're different so let's execute this program and see what happens okay.
See string 1 and 2 are different because string 1 and 2 but the different is different.
This again isn't a G.
So no I'm just replacing with Dennis
C. Now it compared both.
Line by line.
Sorry Carter by character then since both are equal it returns have equal 0 0 a value of zero will be
assigned to this variable.
And I'm just comparing this variable with 0 which is 2 which means it's just 2.
So that's why this is getting printed.
Okay.
So no I'm changing the value again.
For example like I'm just putting this gets also.
It's it's okay so I'm just you know.
No it combined string one string to go to come back character by character and both are not equal.
So that's why a zero well is not returned to this reset variable.
So this way this condition got feet and this particular segment got turned.
So this is this how we can use the string come back function C language thanks for now I'll catch get
you guys back in there amateur video so good bye for now.