 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you what is pointer in C. 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 Techimiz which is available on Google Play. Now, first I am writing the definition of pointer. So pointer is a variable which can store address of any variable. So pointer itself is a variable which can store address of any other variable which is declared in a program. So for demonstration purpose, I am first including a header file. Then I am defining main function. Inside main function, I am declaring a variable that is int a and a is containing value five. Now I want to store address of a variable. For that purpose, I have to declare a pointer. So this notation is pointer declaration. Here P is a pointer variable and a is normal variable. Both are pointing to integer data type. So a is integer variable and P is integer pointer. Now if I want to assign address of a, so I can write this notation P equals to m percent a. Here this m percent operator is denoting address of. So address of a is assigned into P pointer. Now I can use various printf statements. If I want to print value of a, I can write this printf statement. So with the help of this printf statement, I can print value of a and here variable a is used. Now I can also print value of a through the pointer P. For that purpose, I am using another printf statement. So value of a using pointer and here I am using asterisk P. So here this asterisk means value at address. So P is containing address of a. So that's why asterisk P will print value which is available inside a. You can understand it like this. Suppose value of a is 5 and address of a is 101. Now at line number 8, I have assigned address of a into P. Now at line number 8, I have assigned address of a into P. So here I can write value of P equals to 101. So value of P is 101, which is address of a. So pointers value will be address of any other location. That is a variable and pointer itself contains an address. So suppose address of P pointer is 201. I am assuming these addresses. It is not sure that compiler will allocate these addresses. It can be different. So here I am writing asterisk P. So if I write only P, so P is containing the value 101. So simply P means 101. If I convert this notation into asterisk P. So we can write asterisk 101. Now you have to solve this notation asterisk 101. So asterisk means value at address which is written here with the help of comment. So value at address and addresses 101. So now you have to check what is the value of address 101. So here you can see addresses 101 for a and its value is 5. So asterisk P will provide 5 through 101 address which is of a variable. So I hope you have understood through a we can print value of a that is 5. And through asterisk P we can also print value of a but not through name of variable but through its address. So P that is pointer contains address of variable a and through pointer we can access the value of variable easily. Now I am making these statements comment so that I can execute this program. You can see the output value of a is 5 which is printed with the help of a. Then value of a using pointer is also 5 which is printed with the help of P. So friends if you store address of any variable into a pointer then you can receive that variables value with the help of that pointer because pointer contains address of that location. So I hope you have understood this simple demonstration where I have assigned address of a variable into a pointer and I have accessed that variables value with the help of pointer. Now if you want to print the address which is stored inside P for that purpose you can use printf. So this notation will print the address which is stored inside P. So P is containing address of a that's why I have used this notation address of a equals to and then percent P. So percent P is used to print addresses and I have used P variable only that is a pointer. So instead of asterisk P I am using only P. So now you have to see that it will print the address. So you can see address of a is printed here 22f key 44. So this is the exact memory location which is available here and previously I assumed the address that is 101. So this was my assumption. Now you have seen how you can print the actual memory address of a variable with help of pointer. Now if you don't have any pointer then also you want to print address of a variable for that purpose you can write this statement. So here I am again printing address of a but not through pointer but through directly variable. So I have used address of a. So with the help of this notation you can see address of a is printed twice one with the help of pointer and one with the help of variable directly. So this way you can print addresses through variables and with the help of pointers. Similarly you can print values through variables name and through its address also. So after this explanation you can imagine that there is a memory location whose two identifications are available. One is name and one is address. So here in this case memory location is containing value five whose name is a and it is also having an address. So if you want to access the location through its name then you can directly use variable name. But if you want to use a value of that memory location through address then pointer is required. So if and if you want to approach that memory location through its address then only pointer is required. Otherwise you can easily use name of that memory location call any kind of calculation. So this is the simple or easy demonstration of pointer how you can assign address of variable into pointer and how you can print addresses and values with help of that pointer. I hope you have understood whatever I have explained in this demonstration. If you want to watch more programming related videos you can follow or subscribe my YouTube channel through the URL youtube.com. You can download my programming app Techimates which is available on Google Play. Thank you for watching this video.