c# - 关于位移符号 >> 和 << 的使用
1.前言
这是对二进制数据进行位移的方法
2.操作
using System; namespace ConsoleApp1.toValue { public class test1 { public static void Main(string[] args) { /* 60 = 0011 1100 */ const int a = 60; //1111 0000 const int a2 = a << 2; //0011 11 const int a3 = a >> 2; Console.WriteLine(a); Console.WriteLine(a2); Console.WriteLine(a3); } } }
3.控制台打印
本文来自博客园,作者:岑惜,转载请注明原文链接:https://www.cnblogs.com/c2g5201314/p/13576536.html
响应开源精神相互学习,内容良币驱除劣币