Can I print the element names of a structure in C++?
Example: If I have the structure in my code as
struct Info {
uint8_t ID;
uint8_t Weight;
uint8_t Time[3];
}
I want my console to print the text below without hard-coding them. I want it to be extracted from the struct. Is this possible?
ID, Weight, Time0, Time1, Time2
Note: not the value of ID or what not. I would want the console to print the words "ID, Weight... etc". It will be used as field names for a file.