#include<iostream>
using namespace std;
void print(void* ptr, char type) {
switch (type)
{
case'i': {
cout << *((int*)ptr) << endl;
}break;
case'c': {
cout << *((char*)ptr) << endl;
}break;
}
}
int main() {
/*void pointers can hold the
values of other variable like char, int, foat
limitation: Is that u can not
directly dereference a void pointer*/
int num = 5;
char let = 'b';
print(&num, 'i');
print(&let, 'c');
return 0;
}