Printing values of all fields in C++ structure
- by Zhinkaas
Say a simple structure
struct abc
{
int a;
char b;
}
I got some value in a variable defined as its structure and now I want to print below
a = [some value]
b = [some character]
What is the best way to achieve this for an arbitrary structure without having to write a dump...(...) function for each of the structure I encounter?