Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rutgers!columbia!cubmol!ping From: ping@cubmol.bio.columbia.edu (Shiping Zhang) Newsgroups: comp.lang.c Subject: array of bits field Message-ID: <1990Feb12.182517.10921@cubmol.bio.columbia.edu> Date: 12 Feb 90 18:25:17 GMT References: <2802@cunixc.cc.columbia.edu> <22287@mimsy.umd.edu> <7184@arcturus> <11961@frog.UUCP> Reply-To: ping@cubmol.bio.columbia.edu (Shiping Zhang) Organization: Dept. of Biology, Columbia Univ., New York, NY Lines: 26 Is there a way to define an array of bits field which are tightly packed? I tried the following but it caused compiling error. struct { int bits[16]:1; } bits; What I intended to do is as following: first define an union: union { int i; struct { int bits[16]:1; } bits; } bits; then assign a ingeter to bits.i; then get the bit pattern of bits.i via using bits.bits.bits Thanks. -ping