Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdalign.h>
- struct st {
- int n;
- char c;
- };
- struct __attribute__((packed)) incl {
- struct st st1;
- unsigned char x;
- struct st st2;
- };
- int main(int argc, char ** argv) {
- printf("alignof(st) - %d\n", alignof(struct st));
- struct incl incl;
- printf("incl - %p\n", &incl);
- printf("incl.st - %p\n", &incl.st1);
- printf("incl.st - %p\n", &incl.st2);
- }
Advertisement