Re: offsets of fields in a structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19/10/2007, Giulio Rossato <giulio.rossato@xxxxxxxxxxxxx> wrote:
> I want write a function that receives as parameters a start address and
> a "description of a structure" and returns the offsets of the fields.
> The structure is not known at compile time. The offsets should be
> calculated at runtime and the code should be independent of the machine.
> How should be written this function?

Have a look at the Linux manpage for the "offsetof(type,
member)"-macro from stddef.h. It will probably not be exactly what
you're looking for, but might be a starting point which gets you
going.

Jan
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux