Paste number 150153: | sizeof & padding |
Pasted by: | remi`bd |
When: | 6 years, 10 months ago |
Share: | Tweet this! | http://paste.lisp.org/+37UX |
Channel: | None |
Paste contents: |
#include <stdio.h> #include <stddef.h> #define alignof(type) __alignof__(type) struct foo { char *bar; unsigned int baz; }; int main(void) { printf("sizeof(foo) = %zd\talignof(foo) = %zd\n", sizeof(struct foo), alignof(struct foo)); return 0; }
Annotations for this paste:
Annotation number 1: | Output |
Pasted by: | remi`bd |
When: | 6 years, 10 months ago |
Share: | Tweet this! | http://paste.lisp.org/+37UX/1 |
Paste contents: |
$ ./sizes sizeof(foo) = 16 alignof(foo) = 8