Created
July 4, 2014 04:39
-
-
Save jimexist/44162bb38eb330510e44 to your computer and use it in GitHub Desktop.
test_padding.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
struct padded { | |
short s; | |
int i; | |
}; | |
int main(int argc, char **argv) { | |
// this should give in memory (8 bytes): | |
// 0xffff1234, 0x00005678 | |
struct padded pa = { 0x1234, 0x5678 }; | |
printf("%p %p\n", &pa.s, &pa.i); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment