Friday 15 March 2013

c++ - Identify the data type of a class member -


I am navigating through square members and I am trying to figure out which data type is .

  class ZObject {public: int a; // 0x00 bowl b; // 0x01 DWORD c; // 0x02DedWorlds D; // 0x03D 3D Excl. 3e; // 0x04}; DWORD offset = 0x01; Zero PrintDataType (DWORD * pointertozobject) {printf (typed (* (pointertoobobjax + offset)) .name ()); }   

I keep increasing from offset + 0x01 , for each call I work on this function, but it always Unsigned long which is the type of pointertozobject , how can I print a class member's datatype offset? (I do not need this indicator, I need to recognize it)

"post-text" itemprop = "text">

C ++ doesn 'that There is no type of reflection in the form of a comment, your expression is type is DWORD so that you get the answer you received. This address is meaningless.

To find the type from the structure offset, you must offsetOf () plus typeid () to manually note the type of each member and its offset for. Then you can find the table for the desired offset and find the type.

No comments:

Post a Comment