Hi Friends,
Is there any method to find the number of structure members in a given structure.
And is there any method to check whether a structure member is int or char or string.
Regards,
Bhaskar Reddy.
This is a discussion on How to find number of structure members in a given structure? within the C Programming forums, part of the General Programming Boards category; Hi Friends, Is there any method to find the number of structure members in a given structure. And is there ...
Hi Friends,
Is there any method to find the number of structure members in a given structure.
And is there any method to check whether a structure member is int or char or string.
Regards,
Bhaskar Reddy.
Why do you need to do this introspection?
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
Hi LaserLight,
In my project, i want to receive a struct, and find out how many number of members are there and their types. based on the type i have to call appropriate API to insert that value into a table.
Regards,
Bhaskar Reddy.
Could you embed some kind of type information as a member of the struct?
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
Might you have the option of doing this in C++? While it's still not easy or widely scalable, it's certainly easier... much easier.