c#byte字节流的读取_C#中的byte关键字
c#byte字節(jié)流的讀取
C#字節(jié)關(guān)鍵字 (C# byte keyword)
In C#, byte is a keyword which is used to declare a variable that can store an unsigned value between 0 to 255. byte keyword is an alias of System.Byte.
在C#中, byte是一個(gè)關(guān)鍵字,用于聲明一個(gè)變量,該變量可以存儲(chǔ)0到255之間的無符號(hào)值。byte 關(guān)鍵字是System.Byte的別名。
It occupies 1 byte (8 bits) in the memory.
它在內(nèi)存中占用1個(gè)字節(jié)(8位)。
Syntax:
句法:
byte variable_name = value;It can store value between 0 to 255.
它可以存儲(chǔ)0到255之間的值。
C#代碼演示byte關(guān)鍵字示例 (C# code to demonstrate example of byte keyword)
Here, we are declaring a byte variable num, initializing it with the value 120 and printing its value, type, and size of a byte type variable.
在這里,我們聲明一個(gè)字節(jié)變量num ,將其初始化為值120并打印其值,類型和字節(jié)類型變量的大小。
using System; using System.Text;namespace Test {class Program{static void Main(string[] args){//byte variable declarationbyte num = 120;//printing valueConsole.WriteLine("num: " + num);//printing type of variableConsole.WriteLine("Type of num: " + num.GetType());//printing size of a bool Console.WriteLine("Size of a byte variable: " + sizeof(byte));//hit ENTER to exitConsole.ReadLine();}} }Output
輸出量
num: 120 Type of num: System.Byte Size of a byte variable: 1翻譯自: https://www.includehelp.com/dot-net/byte-keyword-in-c-sharp.aspx
c#byte字節(jié)流的讀取
總結(jié)
以上是生活随笔為你收集整理的c#byte字节流的读取_C#中的byte关键字的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: java 方法 示例_Java语言环境g
- 下一篇: 带有示例的Python date str
