This documentation is archived and is not being maintained.

Compiler Error C2150

Error Message

'identifier' : bit field must have type 'int', 'signed int', or 'unsigned int'

bit fields are required to be int, signed int, or unsigned int.

The following sample generates C2150:

// C2150.cpp
// compile with: /c
struct A {
   float a : 8;    // C2150
   int i : 8;   // OK
};
Show: