c#longlong_C#中的long关键字
c# long long
C#uint关键字 (C# uint keyword)
In C#, long
long is a keyword which is used to declare a variable that can store a signed integer value between the range of --
long keyword is an alias of System.Int64.
9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. long keyword
-9,223,372,036,854,775,808到
在C#中, long
writeline输出数值变量long是⼀个关键字,⽤于声明⼀个变量,该变量可以存储介于-9,223,372,036,854,775,808到
long关键字是System.Int64的别名。
9,223,372,036,854,775,807之间的有符号整数值。 long关键字
It occupies 8 bytes (64 bits) space in the memory.
它在内存中占⽤8个字节(64位)的空间。
Syntax:
句法:
long variable_name = value;
C#代码演⽰long关键字的⽰例 (C# code to demonstrate example of long keyword)
Here, we are declaring a long variable num, initializing it with the value 12345
long
12345 and printing its value, type and size of a long type variable.
type variable
长型变量的⼤⼩。
12345对其进⾏初始化,并打印其值,类型和长型变量的
在这⾥,我们声明⼀个长变量num ,使⽤值12345
using System;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
//variable declaration
long num = 12345;
//printing value
Console.WriteLine("num: " + num);
//printing type of variable
Console.WriteLine("Type of num: " + num.GetType());
//printing size
Console.WriteLine("Size of a long variable: " + sizeof(long));
//printing minimum & maximum value of long
Console.WriteLine("Min value of long: " + long.MinValue);
Console.WriteLine("Max value of long: " + long.MaxValue);
//hit ENTER to exit
Console.ReadLine();
}
}
}
Output
输出量
num: 12345
Type of num: System.Int64
Size of a long variable: 8
Min value of long: -9223372036854775808 Max value of long: 9223372036854775807
c# long long
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论