Basic C query.
Basic C query.
- Subject: Basic C query.
- From: Arnab Ganguly <email@hidden>
- Date: Wed, 23 Jun 2010 20:23:42 +0530
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.
Thanks in advance.
-A
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden