output member variables values from a class

Trips

Well-known member
Joined
Aug 7, 2010
Messages
2,788
hello, im looking for a way to systematically output the values of a class without having the manually type each one in
so for example class Foo{
int a;
float b;
string c
}
some function that will output:
a = 2
b = 9.1
c = pancake

so basically a function that will loop through each variable in the class and output its name and current value, any help with this would be great, thanks



View the full article
 
Back
Top