Getting name and type of a struct field from its object
Posted
by Aamir
on Stack Overflow
See other posts from Stack Overflow
or by Aamir
Published on 2010-03-25T09:44:43Z
Indexed on
2010/03/25
9:53 UTC
Read the original article
Hit count: 288
For example, I have a struct which is something like this:
struct Test
{
int i;
float f;
char ch[10];
};
And I have an object of this struct such as:
Test obj;
Now, I want to programmatically get the field names and type of obj
. Is it possible?
This is C++ BTW.
© Stack Overflow or respective owner