site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-3.fc13 Thunderbird/3.0.4 Dear All, Sorry for posting a basic C question.Below is the code base. struct Test { int a; int b; }; //member offset. int result = (((Test *) 8)->a) - 8; I get bus error for this. I am not clear about the logic as what exactly ((Test *) 8)->a signifies here and why -8 is done. I have copy pasted a smaller portion of the main code.Only one line written as Member offset. The above code works fine in 32bit but in 64bit I am getting issue if I can understand the above logic will be more clear as what needs to be done. Use offsetof() http://en.wikipedia.org/wiki/Offsetof Peter _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On 06/23/2010 09:53 AM, Arnab Ganguly wrote: This email sent to site_archiver@lists.apple.com