G
Guest
Hi,
I have used bitfields in C before and I understand all the AND/OR operations
etc. While learning C# I was told to mark all by "bitfield enums" with the
[Flags] attribute. Do why? Exactly what does this attribute do?
The MSDN docs says: " Indicates that an enumeration can be treated as a bit
field; that is, a set of flags." but that really doesn't tell you anything
substantial:
http://msdn2.microsoft.com/en-us/library/system.flagsattribute.aspx
I have tried to use & for enumerations with and without the attribute, both
ways work just fine?!
Regards,
Martin
I have used bitfields in C before and I understand all the AND/OR operations
etc. While learning C# I was told to mark all by "bitfield enums" with the
[Flags] attribute. Do why? Exactly what does this attribute do?
The MSDN docs says: " Indicates that an enumeration can be treated as a bit
field; that is, a set of flags." but that really doesn't tell you anything
substantial:
http://msdn2.microsoft.com/en-us/library/system.flagsattribute.aspx
I have tried to use & for enumerations with and without the attribute, both
ways work just fine?!
Regards,
Martin