Compiler Error C3126
cannot define a union 'union' inside of managed type 'type'
A union cannot be defined inside a managed type.
The following sample generates C3126:
// C3126_2.cpp
// compile with: /clr /c
ref class Test
{
union x
{ // C3126
int a;
int b;
};
};
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for