Does *&s1 refer to the first member of structure variable s1



Does the expression *(int *)&s1 below inside the printf() statement
guarantee to refer to the first member of the structure variable s1?
I've tried the code and it seems that it works that way. The C
standard states this? Thank you very much.

#include <stdio.h>

struct S{
int m1, m2, m3;
};

int main(void)
{
struct S s1 = {3, 4, 5};
printf("%d\n", *(int *)&s1);
return 0;
}

/*
$ gcc -ansi -pedantic -W -Wall a.c
$ ./a.exe

3

$
*/

.



Relevant Pages

  • [VulnWatch] MEME156 + MS SQL BRUTE THING!
    ... *so deeply into the architecture of your thoughts that the words MeMe ... We refer to other sub.systems, and in doing so, interweave their memetic approaches ... register int i; ... char user; ...
    (VulnWatch)
  • [Full-Disclosure] MEME156 + MS SQL BRUTE FORCE TEKNEEQ
    ... *working exploit attached only for propagation of meme. ... We refer to other sub.systems, and in doing so, interweave their memetic approaches ... register int i; ... char user; ...
    (Full-Disclosure)
  • Re: (i++ * i++)
    ... > undefined behavior. ... > references to the same int. ... enforce a crash if the two references refer to the same integer, ... triggered if i1 and i2 refer to the same int, but also if they refer to ...
    (comp.lang.cpp)
  • Re: scared about refrences...
    ... def fn: ... Now x refers to another instance of type int, ... containers like lists and dicts) are mutable. ... Function g modifies the second "slot" in the list - it does not modify the object already in that place, it just makes the second item in the list to refer to another object. ...
    (comp.lang.python)
  • Re: A Query in "Pointers to Structures"
    ... char *word; ... QUERIES: ... What does the following refer to? ...
    (comp.lang.c)