20 lines
326 B
C
20 lines
326 B
C
#include <stdio.h>
|
|
|
|
int main (void) {
|
|
int i = 20;
|
|
float t = 46.827349;
|
|
char c = 'R';
|
|
|
|
void *ptr = NULL;
|
|
|
|
ptr = &i;
|
|
printf("the integer i: %d\n", *(int *)ptr);
|
|
|
|
ptr = &t;
|
|
printf("the float t: %.2f\n", *(float *)ptr);
|
|
|
|
ptr = &c;
|
|
printf("The char c: '%c'\n",*(char *)ptr);
|
|
|
|
return 0;
|
|
} |