Hopefully I can ask this clearly. Basically I'm wondering if I have a structure like so:
struct MyStruct
{
char fieldA[20];
char anotherField[15];
int andAnother;
char lastField[30];
};
Is there a way to dynamically print out it's contents?
[fieldA] = "ABCDE"
[anotherField] = "TEST"
[andAnother] = 5
[lastField] = "WHATEVER"
With the capability of sending it a completely different structure (different fields, different sizes, different number of fields, etc.) and it could do the same. I know this is possible in Java using reflection, etc. but wondering if there is a C++ alternative (or close approximation). Note that I would be satisfied even if it required some sort of precompilation for it to work...