Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Error C2034

Error Message

'identifier' : type of bit field too small for number of bits

The number of bits in the bit-field declaration exceeds the size of the base type.

The following sample generates C2034:

// C2034.cpp
struct A {
   char test : 9;   // C2034, char has 8 bits
};

Possible resolution:

// C2034b.cpp
// compile with: /c
struct A {
   char test : 8;
};

Community Additions

ADD
Show:
© 2015 Microsoft