How to define a bitmap at varible
-
hi All, I would like to define at c# a bitmap in a struct Define spesific bit to be use I don't know how to do it at c++ i should define it as typedef struct { unsigned long m_opcode :2; unsigned long m_id :3; unsigned long m_src :4; unsigned long m_address :3; unsigned long m_timer :18; unsigned long m_reserved :1; } WiMAXBlock1HeaderT; how can i define it at C#? thanks ronen
-
hi All, I would like to define at c# a bitmap in a struct Define spesific bit to be use I don't know how to do it at c++ i should define it as typedef struct { unsigned long m_opcode :2; unsigned long m_id :3; unsigned long m_src :4; unsigned long m_address :3; unsigned long m_timer :18; unsigned long m_reserved :1; } WiMAXBlock1HeaderT; how can i define it at C#? thanks ronen
Hi, those are bit fields, not a bitmap. And C# doesn't offer any help at all for doing such things. You could define a struct with public properties that contain code to perform all the bit operations (AND, OR, SHIFT). :)
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
hi All, I would like to define at c# a bitmap in a struct Define spesific bit to be use I don't know how to do it at c++ i should define it as typedef struct { unsigned long m_opcode :2; unsigned long m_id :3; unsigned long m_src :4; unsigned long m_address :3; unsigned long m_timer :18; unsigned long m_reserved :1; } WiMAXBlock1HeaderT; how can i define it at C#? thanks ronen
-
hi All, I would like to define at c# a bitmap in a struct Define spesific bit to be use I don't know how to do it at c++ i should define it as typedef struct { unsigned long m_opcode :2; unsigned long m_id :3; unsigned long m_src :4; unsigned long m_address :3; unsigned long m_timer :18; unsigned long m_reserved :1; } WiMAXBlock1HeaderT; how can i define it at C#? thanks ronen
This looks a little like a
BitArray
. You might take a look at the documentation MSDN[^], and see if it suits.Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”