This is one of those that I think this should work, but it is best to check the questions. It compiles and works great on my machine.
Is this guaranteed what I expect (for example, to allow me access to the first elements of the array with the guarantee that the layout, alignment, addition, etc. of the structure matches the array)?
struct thingStruct
{
int a;
int b;
int c;
};
void f()
{
int thingsArray[5];
struct thingStruct *thingsStruct = (struct thingStruct *)&thingsArray[0];
thingsArray[0] = 100;
thingsArray[1] = 200;
thingsArray[2] = 300;
printf("%d", thingsStruct->a);
printf("%d", thingsStruct->b);
printf("%d", thingsStruct->c);
}
EDIT: - ? , mmapping . "", , - . , , . , .