Just with a void* not possible. Only possible, if you create the structure for each variable and enclose the type inside it. But that would be completely different programming. Lots of overhead and unreadable.
enum VarTypes
{
INTEGER = 1,
FLOAT,
DOUBLE,
CHAR
};
typedef struct
{
void* DataPtr;
int SizeInBytes;
int Type; // Values from VarTypes set
}
MYVAR;
int a = 9;
float b = 763.34f;
double c = 6327.9988737;
char s = 'A';
MYVAR var1 = { &a, sizeof (a), INTEGER };
MYVAR var2 = { &b, sizeof (b), FLOAT };
MYVAR var3 = { &c, sizeof (c), DOUBLE };
MYVAR var4 = { &s, sizeof (s), CHAR };
Now, you must pass var1...4 to every function to deal with variables. In short: BAD IDEA!