Skip to content

Instantly share code, notes, and snippets.

@erickt
Created February 1, 2010 06:57
Show Gist options
  • Save erickt/291507 to your computer and use it in GitHub Desktop.
Save erickt/291507 to your computer and use it in GitHub Desktop.
#include <stddef.h>
#include <stdio.h>
typedef enum enum_t {tag} type;
struct TEST { char c; type mem; };
int main() {
printf("%d\n", (int)offsetof(struct TEST, mem));
printf("%d\n", (int)sizeof(type));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment