July 28th, 2003, 01:54 AM
Structures in C
Is there any way in C to find the fields in a astructure that are pointers to any type.
July 28th, 2003, 04:49 AM
>>Is there any way in C to find the fields in a astructure that are pointers to any type.
???????? Look for the *'s?
pointers are usually 4 bytes (but so are many other data types)
Don't you have the structure declaration? If not, why not?
or do you mean void* ( void pointer will be a pointer to any data type )
The essence of Christianity is told us in the Garden of Eden history. The fruit that was forbidden was on the Tree of Knowledge. The subtext is, All the suffering you have is because you wanted to find out what was going on. You could be in the Garden of Eden if you had just kept your f***ing mouth shut and hadn't asked any questions.
July 28th, 2003, 06:22 AM
Re: Structures in C
You really need the structure's definition. Your compiler won't have anything to do with it otherwise. There isn't a safe and reliable way to access the members of a structure when you only have a void* until you cast it to a specific structure.
Articles and commentary on web development