【问题标题】:Combining multiple bytes into a single int (C#)将多个字节组合成一个 int (C#)
【发布时间】:2022-06-17 00:16:01
【问题描述】:

有2个字节的变量(例如):

byte byte_variable1 = 87; // = 0101 0111
byte byte_variable2 = 16; // = 0000 1111

我需要将其转换为 int (byte_variable1 + byte_variable2):

int output_int_variable = 22287; // = 0101 0111 0000 1111

如何在 C Sharp 中做到这一点?提前非常感谢!

【问题讨论】:

  • 花点时间阅读帮助中心的editing help。 Stack Overflow 上的格式化与其他站点上的不同。您的帖子看起来越好,其他人就越容易阅读和理解。

标签: c# byte


猜你喜欢
  • 1970-01-01
  • 2013-04-19
  • 1970-01-01
  • 2017-09-12
  • 2015-04-13
  • 2012-09-10
  • 1970-01-01
  • 2018-11-14
  • 1970-01-01
相关资源
最近更新 更多