Skip to content

Instantly share code, notes, and snippets.

@thiagopnts
Created November 10, 2013 12:53
Show Gist options
  • Save thiagopnts/7397890 to your computer and use it in GitHub Desktop.
Save thiagopnts/7397890 to your computer and use it in GitHub Desktop.
Bit field example
#include <stdio.h>
typedef struct
{
unsigned int a: 1;
unsigned int b: 1;
unsigned int c: 1;
} type;
int main()
{
printf("size: %d\n", sizeof(type)); // 4 bytes
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment