Is pointer to struct a pointer to its first member?
问题 I'm learning how to work with struct s in C and wrote the following example: #include <stdio.h> #include <stdlib.h> struct s1{ unsigned short member; }; int main() { struct s1 *s1_ptr = malloc(sizeof(*s1_ptr)); s1_ptr -> member = 10; printf("Member = %d\n", *s1_ptr); // Member = 10 } QUESTION: Is it guaranteed that in all cases a pointer to a struct is a exactly the same pointer to its first element? In this particular case it works as I expected, but I'm not sure if it is guaranteed. Is