C# 控制台输出
【摘要】
建立Console应用程序
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
...
建立Console应用程序
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//将整数转换为字节类型
//4个字节类型的数组可以转换为最大值 为4294967295的整数。
byte[] bytes = BitConverter.GetBytes(4294967295);
Console.WriteLine("byte array :" + BitConverter.ToString(bytes));
//等待输入
Console.ReadKey();
}
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
Byte 数据类型
Byte 变量以无符号的 8 位(1 个字节)数字的形式存储,取值范围为 0 到 255。
Byte 数据类型用于存放二进制数据。
注意 Byte 数据类型可以转换为 Short、Integer、Long、Single、Double 或 Decimal 数据类型,而不会出现 System.OverflowException 错误。
等价的 .NET 数据类型是 System.Byte。
文章来源: blog.csdn.net,作者:fengda2870,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/fengda2870/article/details/51539272
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)