#include <stdio.h>
#define KeyValueTypeDefine(Type) \
typedef struct \
{ \
char *Key; \
Type Value; \
}KeyValueStruct_##Type;
// You can only use these exact type-names you define.
KeyValueTypeDefine(int);
KeyValueTypeDefine(short);
KeyValueTypeDefine(char);
#define KeyValue(Type,VariableName,ValueInput) \
KeyValueStruct_##Type VariableName; \
VariableName.Key = #VariableName; \
VariableName.Value = ValueInput
int main()
{
KeyValue(char,SomeName,255);
printf("%s\n",SomeName.Key); // String
printf("%i\n",SomeName.Value); // Value of some Type
printf("%lu\n",sizeof(SomeName));
return 0;
}