 Hello friends, I am Sanjay Gupta. I welcome you on my channel. You can watch various programming related videos on my YouTube channel. It contains more than 800 videos. You can search those videos with the help of keyword programming by Sanjay Gupta. In this video, I am going to demonstrate you how to pass string into functions in C programming. For example, I am taking find out length of string example. So first of all, I am going to include a header file that is a stdio.h. Then I am declaring a function whose return type is int name is length and it will receive character array as an argument. So this is function declaration. Now I am going to define main function definition. So here I have declared a character array and int is a variable l for length. With the help of print, I am going to display the message enter a string. That string will be received from user with help of getters method. Now I am going to call length function and I am going to pass the string in it. So this is calling of function. You can see I am passing str which is character array into the function length. So this method is known as passing string into function and the returned value will be stored inside l variable. So I can use it as output. So this way length will be displayed on output screen. So this is the definition of main function. Now I am going to define definition of length function. This block will be known as definition of function. Inside this block I am going to apply the logic which will calculate length of string. So here I am initializing this variable l with 0 and another variable I have declared. Now I am initializing a loop with i equals to 0. Then str of i not equals to null and i++. Inside this loop I am going to increase value of l. So in case of string we all know that at the end of string null character is present. So we can iterate a loop till null is available in the string. If null is occurred then this loop will be terminated. So if null is not present then this loop will repeat. Whenever loop reaches to null position then this loop will be terminated. And the counting will be stored inside l variable which is counting the length of string. Or you can say how many characters are available in the string. After calculation I can return value of l with the help of return keyword. So this return value will be stored inside the variable which is available at function call. So in our example it is available at line number 11. So line number 11 l will be receiving the actual value in form of length. And at line number 12 it will be displayed on output screen. So this way I am passing string into function and then processing it into another function. So here two functions are available main and length. Main is calling the length function and length is providing the actual processing so that we can find out how many characters are available in the string. Now I am going to execute this code. I am passing my name or I am entering my name as input. You can see it is showing length equals to 6. So my name contains 6 characters that's why it is printing 6 as output. So this way I have demonstrated you how you can pass a string into a function in C programming. I hope you have understood whatever I have explained or discussed in this video. If you want to watch more programming related videos you can follow my YouTube channel. Thank you for watching this video.