/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <stdio.h>
void printValue(void* ptr, char type){
switch(type){
case 'i':
printf("%d\n",*(int*)ptr);
break;
case 'f':
printf("%f\n",*(float*)ptr);
break;
case 'c':
printf("%c\n",*(char*)ptr);
break;
}
}
int main()
{
int i = 23;
float f = 4.5;
char c = 'z';
printValue(&i, 'i');
printValue(&f,'f');
printValue(&c,'c');
return 0;
}