typedef struct foo { unsigned char foo_0:2, foo_1:2, foo_2:2, foo_3:2; char str[255]; int i; } foo; #include int main() { foo bar; foo foobar; char *s="Hello, World\n"; bar.foo_0=0; bar.foo_1=1; bar.foo_2=2; bar.foo_3=3; strcpy(bar.str, s); printf("%d %d %d %d\n", bar.foo_0, bar.foo_1, bar.foo_2, bar.foo_3); printf("%s\n", bar.str); printf("%d\n", bar.i); foobar=bar; printf("%d %d %d %d\n", foobar.foo_0, foobar.foo_1, foobar.foo_2, foobar.foo_3); printf("%s\n", foobar.str); printf("%d\n", foobar.i); }