# Include <stdio. h>
# Include <afx. h>
Struct {
Int I; char J; char J1;
Short int Si;
Char * PTR;
Long array [100]; char B [5]; char C1; char * C ;};
# Define print_me (char *) & (struct a *) 0)-> C)
Void main ()
{/*
Printf ("% d \ n", (char *) & (struct a *) 0)-> I ));
Printf ("% d \ n", (char *) & (struct a *) 0)-> j ));
Printf ("% d \ n", (char *) & (struct a *) 0)-> PTR ));
Printf ("% d \ n", (char *) & (struct a *) 0)-> array ));
Printf ("% d \ n", (char *) & (struct a *) 0)-> B ));
Printf ("% d \ n", (char *) & (struct a *) 0)-> C ));
*/
Printf ("% d \ n", & (struct a *) 10)-> I ));
Printf ("% d \ n", & (struct a *) 10)-> j ));
Printf ("% d \ n", & (struct a *) 10)-> J1 ));
Printf ("% d \ n", & (struct a *) 10)-> Si ));
Printf ("% d \ n", & (struct a *) 10)-> PTR ));
Printf ("% d \ n", & (struct a *) 10)-> array ));
Printf ("% d \ n", & (struct a *) 10)-> B ));
Printf ("% d \ n", & (struct a *) 10)-> C1 ));
Printf ("% d \ n", & (struct a *) 10)-> C ));
Printf ("% d \ n", sizeof (short INT ));
Printf ("% d \ n", sizeof (INT ));
Printf ("% d \ n", sizeof (char ));
Printf ("% d \ n", sizeof (char *));
Printf ("% d \ n", sizeof (long ));
Printf ("% d \ n", sizeof (tchar ));
// Printf ("% d \ n", print_me );
}
Allocate a space greater than or equal to 4 bytes, starting from an integer multiple of 4.
Allocate a space smaller than 4 bytes. If the space allocated by the first 4 integers can be put down, it is allocated to the remaining space. Otherwise, it is allocated by an integer multiple of the four.
& (Struct a *) 10)-> I) // considers the starting position of the struct space as 10 and returns the position of the I variable.
& (Struct a *) 0)-> I) // considers the starting position of the struct space as 0 and returns the position of the I variable.