Compiler Error C2104
Visual Studio 2015
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at Compiler Error C2104.
on bit field ignored
You cannot take the address of a bit field.
The following sample generates C2104:
// C2104.cpp
struct X {
int sb : 1;
};
int main() {
X x;
&x.sb; // C2104
x.sb; // OK
}
Show: