void type pointer

Preview

void type pointer

Just like other data types, we can declare a pointer variable of void type. In case of other data types, the data type of pointer variable and the variable whose address is to be stored in pointer variable must be same but in case of void type pointer variable, address of variable of any other data type can be stored in void type pointer variable.


Program to demonstrate void type pointer variable
#include<stdio.h>
int main()
{
int b=10;
void *a;
a=&b;
printf(“a=%u”,a);
return(0);
}
Output
a=65524



Best Books of C





Lesson tags: void pointer in c, void type pointer variable in c
Back to: C Programming Language