In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article Xiaobian for you to introduce in detail "how to use the bit operator in C#", the content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to use the bit operator in C#" can help you solve your doubts. Let's follow the editor's way of thinking to learn new knowledge.
Example
Take a look at the following example for all the bit operators available in C#:
Using System
Namespace OperatorsAppl
{
Class Program
{
Static void Main (string [] args)
{
Int a = 60; / * 60 = 0011 1100 * /
Int b = 13; / * 13 = 0000 1101 * /
Int c = 0
C = a & b; / * 12 = 0000 1100 * /
Console.WriteLine (value of "Line 1-c is {0}", c)
C = a | b; / * 61 = 0011 1101 * /
Console.WriteLine (the value of "Line 2-c is {0}", c)
C = a ^ b; / * 49 = 0011 0001 * /
Console.WriteLine (the value of "Line 3-c is {0}", c)
C = ~ a; / *-61 = 1100 0011 * /
Console.WriteLine (value of "Line 4-c is {0}", c)
C = a 2; / * 15 = 0000 1111 * /
Console.WriteLine (value of "Line 6-c is {0}", c)
Console.ReadLine ()
}
}
}
When the above code is compiled and executed, it produces the following results:
Line 1-c value is 12Line 2-c value is 61Line 3-c value is 49Line 4-c value is-61Line 5-c value is 240Line 6-c value is 15 read here, this "how to use the bit operator in C #" article has been introduced, want to master the knowledge of this article also need to practice in order to understand, if you want to know more related content of the article, welcome to pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.