Hy all, please tell me how in C# initialize variable in a several bits, for example in visual C it has been done as:
char variablename:3;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Bit fields is a C language feature, it doesn’t exist in C#. Consider the BitArray class or the efficient BitVector32 structure instead. Beware that bit fields are expensive, favor byte or int if perf matters.