Hi all,
I read the below question in a blog, and I am not sure if a portable way to do the same exists, or even a way to do this in C.
A function accepts an address of a structure member (not necessarily the first member) as its only argument. Given this is there a way to find out the start address of this structure object in memory. Assuming the hardware supports non aligned reads (implementation not important) and the compiler never pads the alignment bytes.
Please advice.
Thanks,
Gsi.
I read the below question in a blog, and I am not sure if a portable way to do the same exists, or even a way to do this in C.
A function accepts an address of a structure member (not necessarily the first member) as its only argument. Given this is there a way to find out the start address of this structure object in memory. Assuming the hardware supports non aligned reads (implementation not important) and the compiler never pads the alignment bytes.
Please advice.
Thanks,
Gsi.
Comment