 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can use Void 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 Techimace which is available on Google Play. Now I am going to demonstrate you the use of Void pointer with the help of C programming. So first you have to understand what is Void pointer. So Void pointer can store address of any type of variable. So it is a spatial pointer which can hold address of any type of variable. Now to de-reference this Void pointer, you have to typecast it into a particular type. Now I am going to demonstrate you how you can do this. So first I am including a header file that is stdio.h. Then inside main function, I am declaring an integer variable that is a. Then I am declaring a float variable that is b. Both are initialized with a particular value a is having 5 and b is having 10.5. After these declarations, I am declaring a pointer that is p and you can see its data type is void pointer. So p is a spatial pointer which can hold address of a as well as address of b. So first I am assigning address of a into p. Now I can de-reference it. So for that purpose, I am using this printf statement and I am writing asterisk p. So this asterisk sign is for de-referencing. So I am de-referencing p pointer so that I can print the value of a on console. But when I will be compiling this code, you can see it is showing an error in valid use of Void expression. So void pointer is containing base address of a but it doesn't know how many bytes it has to de-reference. So first I have to convert this p into integer pointer then only it will work properly. So for that purpose, I am using this notation. So you have to see that using this asterisk, I am converting p that is void pointer into integer pointer. So after applying this notation p is converted into integer pointer and then I am de-referencing it with another asterisk. So right now this expression is valid and it will print proper results on console. So I am executing this code. You can see value of a equals to 5 is displayed on console properly. So this way I have typecasted or type converted void pointer into integer pointer. Now let's see whether we can store address of b variable into p pointer or not. So this time I am assigning address of b variable. So b is flow type variable and p is again void pointer but I am assigning address of b into p. Now again I am using printf statement so that I can print value of b on console. Again I am using only asterisk p. I am compiling this code. You can see same error in valid use of void expression. So here also I have to convert this void pointer into float pointer. So I am using float asterisk. So this way I have converted void pointer into float pointer and then I have de-referenced it with another asterisk symbol. So this time it will show the correct results on console. You can see the output value of a is 5 and value of b is 10.5. So this way void pointer can store address of any type of variable. But at the time of de-referencing you have to convert void pointer into a particular type pointer so that proper number of bytes can be de-referenced. So I hope you have understood how we can use void pointer in C programming to store addresses of different variables. If you want to watch more programming related videos you can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app TechMS which is available on Google Play. Thank you for watching this video.