114. Void Pointer
#include<stdio.h>
void
*v;
char
ch='c';
int
i=10;
float
f=23.5;
void
main()
{
v=&ch;
printf("%c\n",*(char *)v);
v=&i;
printf("%d\n",*(int *)v);
v=&f;
printf("%f\n",*(float *)v);
}
#include<stdio.h>
void
*v;
char
ch='c';
int
i=10;
float
f=23.5;
void
main()
{
v=&ch;
printf("%c\n",*(char *)v);
v=&i;
printf("%d\n",*(int *)v);
v=&f;
printf("%f\n",*(float *)v);
}
Comments
Post a Comment