 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can print reverse of string by passing 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 Sanjay Gupta 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 with the help of C programming. So first I am including a header file that is stdio.h. Now I am declaring a function whose name is reverse, its return type is void and its argument type is character pointer. So this statement is function declaration. Now I am defining main function. Here I have declared a character array SER then through printf the message enter string will be displayed on console and the entered contents will be received through getters and they will be stored inside str string. Now I am calling reverse function and I am passing string inside it. So this statement is function calling and after that I am writing return 0. So this is the definition of main. Now I have to define definition of reverse function. So this block will be known as function definition and here you can see as an argument p pointer is available which will receive base address of str. So now through p pointer I can access all the locations of str character array. Now I am declaring two variables I and C of integer type and I am applying for loop. Here you can see it is initialized I with 0. Now I am writing a condition strp plus I not equals to null and then I plus plus. So this way I have implemented for loop which will increase value of C by 1. So here you can see strp plus I. So p is having base address I have added I into a and then I have dereferenced it. So p will be always pointing to the base location and through plus I it will move to the next locations and it will dereference those locations. Then it will check whether it is equals to null or not. So if it is not equals to null then C variable will be incremented by one. Otherwise this loop will be terminated. So this way I am counting how many characters are available in string. Now after this counting I am implementing another loop which I am initializing with C minus one. So you know that the number of characters suppose a string is containing five characters. So number of characters will be five. But fifth location will be available on fourth index because index in string starts from zero. That's why I have initialized I with C minus one. Then condition will be I greater than equals to zero and then I minus minus. So I have to print string in reverse order. That's why I have initialized I with C minus one. Now with the help of print f percent C I am going to print string in reverse order. So for that purpose again I am using S risk P plus I. So P is pointing to the base address. I am adding I into it. So I is initialized with C minus one. So it will point to the last character of string and that character will be displayed through this S risk symbol. Then I will be decremented by one. So second last element will be displayed then. So this way string will be printed in reverse order on console and I can print the masses string reverse equals to. So this way I have implemented the complete code in front of you. First I have counted number of characters and then those characters will be printed in reverse order. And you can see I have implemented all the logic with the help of pointer. Now I am executing this code. I have entered Sanjay. You can see the output string reverse equals to why a J and AS. So this is the reverse of my name. So program is working properly. It is printing reverse of the content which are provided by the user. So this way I have print reverse of string by passing string into function using pointer. I hope you have understood the logic well. If you want to watch more programming related videos, you can follow or subscribe my YouTube channel through the URL youtube.com slash Sanjay Gupta underscore tech school. You can download my programming app tech image which is available on Google Play. Thank you for watching this video.