 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can pass structure into function using pointer. Before starting, you can note how you can search my YouTube channel. You can type my name Sanjay Gupta in YouTube search bar. My channel will be available there. You can watch various programming related videos there. Now I am going to implement solution of this problem. So first time including a header file that is stdo.h. Now I am going to declare a structure whose name is book. It will be having first member that is book number. It is integer type variable. Then second member is name which belongs to character array and then third variable or member that is price of flow type. After this structure declaration, I have to declare a function. So name of function is display. Its return type is void and it will receive an address of structure variable. So the argument type is struct book asterisk p. So p is a pointer that belongs to struct book. So this statement is function declaration. Now I am going to define main function. Inside main function, I am declaring a variable struct book b. So b is a variable. Its data type is struct book. Now to receive values from user, I have to implement this printf function which will display enter book number masses on output screen to read values from user. I am calling scanner function and I am writing b.book number. So the book number will be stored inside b and o variable that is available within b variable of structure type. Then to receive name, this message will be displayed on output screen. Now before calling gattas function, I have to call fplush stdin. I have called this fplush function because I want to clean the buffer before I am going to read characters from user. So for that purpose, I have used fplush function and then gattas. So gattas will be reading name of book from user that will be stored inside b.name. So whenever you want to read characters just after integers, then you have to call fplush function. Now I am calling printf again which will display the masses and the price on output screen and that price will be received from user through scanf and will be stored inside b.price. So this way I have received all the information from user. Now I am calling display function and I am passing address of b variable. So this statement is function call. Here I am passing address of b variable which will be received through a pointer inside display function definition. So this is complete definition of main. Now I have to define definition of display function. So this block will be known as function definition. Here displays name void is return type and p is a pointer of struct book type which will be receiving address of b variable. Now I can print the information through this p pointer. So first this caption will be displayed that is book details then to print book number this masses will be displayed then p arrow book number. So here you have to focus that through I have access the members through p pointer. So whenever you want to access members of structure variable through the pointer then you have to use this arrow notation that is framed through hyphen and greater than sign. So p is a pointer that's why I have used this notation to access members of structure. Now to print name again I am using this p arrow notation and I am used sorry I have used name variable then to display price p arrow price. So this way I have displayed all three information book number name and price on output screen with the help of this p pointer. So this way I have passed structure variable into function and that structure variable is received through a pointer. So in definition I have used pointer and in main function I have used a variable of structure. So this way I have demonstrated you how you can pass structure into function using pointer. Now I am going to execute this code so that you can see whether it is printing correct results or not. So book number triple one book name C programming and prices 500. So you can see the output it is showing book details book number triple one name C programming and prices 500. So this way it is printing correct results on output screen. So this is all about how you can pass structure into function using pointer. I hope you have understood the logic which I have demonstrated you in this video. If you want to watch more programming related videos you can search my name Sanjay Gupta in YouTube search bar. My channel will be available on first page of the YouTube. You can watch various programming related videos there. Thank you for watching this video.