 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how we can count length of string by passing string into function. Before starting, you can note my information. You can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app Techimage which is available on Google Play. Now I am going to implement a code with the help of C programming so that you can learn how we can pass string into function to count length of the string. So first time, including a header file that is STDIO dot h. Now I am declaring a function whose written type isn't name of function is length and I will be passing the character array into this function. So this statement is function declaration. Now I am defining main function. Inside main, I am declaring a character array. Now, integer variable C is declared. Then using printf, I am going to display the message enter string on console to receive that string. I am using GATUS. So GATUS will receive the content and the content will be stored inside str. Now I am calling the length function and I am passing string into it in form of str. So this statement is function calling. So this function will be passing str into its definition and the returned value will be received inside C variable. So now I can print the value which is available inside C variable. So I am printing the message length then equals to percent d and then C. So this way result will be displayed on console with the help of this printf statement and then I am using return 0. So this is the definition of main function. Now I am defining length function definition. So this block will be known as function definition. Inside this function, I am declaring a variable I and variable C which is initialized with 0. Now I am applying a for loop which is initialized with 0. Now I am applying the condition str of I not equals to null and then I plus plus. So if the condition str of I is not equals to 0, if it is true, then loop will repeat. Otherwise the loop will be terminated and inside this loop I am counting the value of C. So C will be incremented by 1 every time whenever this loop will repeat. After completion of this loop, I am returning the value of C. So the returned value will be received inside main function at function calling statement and with the help of printf result will be displayed on console. So this way I have implemented the complete code in front of you which is which will calculate length of string and I have passed string into function. Now I am executing this code. So it is asking a string. So I am entering Sanjay. So you can see the length. My name contains total six characters. So it is showing the length which is six. Remember that whenever we count the length of the string null character is not included in the length. So before null character whatever is available in the string that will be counted null will be null will not be included in the length of the string. So this is all about the problem which I have demonstrated in front of you. I hope you have understood how we can implement the how sorry. I hope you have understood how we can count length of a string by passing string into the function. If you want to watch more programming related videos you can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app Techiness which is available on Google Play. Thank you for watching this video.