check whether certain variable is member of that structure


I want to check if certain variable is member of structure or not.

For example, I have a structure like this:

1
2
3
4
5
6
struct distance
{
int feet;
int inches;
char name;
};


How to check if "feet" is member of structure or not?

Last edited on
Please explain more. Show an example, where you have mysterious feet.
For a generic implementation.. I don't know in which structure that variable is initialized. So have to check to each structure in which structure that particular variable is declared...if not check in other structure.
A struct is a class. Members of a class should be initialized by the constructor of the class. Initialization is nobody else's business.
Topic archived. No new replies allowed.