 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how to pass string into function using pointer. Before starting, you can note my information. You can follow or subscribe my YouTube channel through the URL youtube.com slash tanjaygupta underscore tech school. You can download my programming app Techimus which is available on Google Play. Now I am going to implement solution of this problem that how to pass string into function using pointer. So first of all, I am including a header file that is a studio.h. Now I am going to declare a function whose name is print. Its written type is void and it will receive an argument that will be base address of string. So that's why I have declared a character pointer data type as an argument of print function. So this statement is function declaration. Now inside main function, I am declaring an array of character type. Now with the help of printf, the message enter string will be displayed on console and the entered string will be received through gattus and the content will be stored inside str. Now I am calling print function in which I am passing str string and then return 0. So this print str statement is function calling statement. After completion of main function definition, I have to define definition of print. So here I am declaring a pointer of character type and this block will be known as function definition. Inside this function definition, I have to apply a while loop where condition is strp not equals to null. So p is containing base address of str array. So if I want to dereference it or you can say I want to find out the value which is available on that base address. So I have to use strp. So strp will provide the first element of str array. If it is not equals to 0, then I am printing it on console through %c, strp. So this way the content which is available on the address which is stored inside p will be displayed on console. Now I am moving p on next location of that array by using p++. So p will be incremented by 1 and it will be pointing to the next location of that string and then this condition will be checked again. If it is true, then the content will be displayed on console and so on. So this way all the elements of string will be displayed on console and I have passed string into function using pointer. Now I am printing a message that is string contains. So this message will be displayed on console with the help of this printf statement. So now I am executing this code. I am entering my name Sanjay. You can see the output string contains and it is printing Sanjay on console. So there I have passed string into function. That string is received through a pointer and through the pointer I have printed all the contents of that string on console. So I hope you have understood whatever I have demonstrated in this video. If you want to watch more programming related videos, you can follow or subscribe my YouTube channel through the URL youtube.com slash tanjaygupta underscore tech school. You can download my programming app Techimps which is available on Google Play. Thank you for watching this video.