在C#中接受的风格长期VS Int64的? [英] Accepted style for long vs Int64 in C#?

查看:102
本文介绍了在C#中接受的风格长期VS Int64的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道他们是相同的变量类型,但有对是否使用的Int64

I know they are the same variable type, but is there an accepted standard 'style' for whether to use long or Int64?

我想用最常见的一种。

推荐答案

所有的微软文档和代码的99.999%(左右),你会在网上找到将使用。例如见在C#参考数字数据类型定义: http://msdn.microsoft.com/en-美国/库/ exx3b86w.aspx

All documentation from Microsoft and 99.999% (or so) of the code you'll find online will use long. See for instance the numeric datatype definition in the C# reference: http://msdn.microsoft.com/en-us/library/exx3b86w.aspx

在最后,这是使用字符串或字符串。一般来说,小写名称用于值的数据类型,例如数字或字符,大写名称用于类。在C#的Int64 是复杂的数据类型(与字段,属性和方法的结构,看到该文档的这里)为值的数据类型(看到该文档的here )。一般情况下,人们不使用类的Int64 比从类调用的方法,如 Int64.Parse 。所以,你通常会发现这样的事情:

In the end, this is the same issue with using string or String. In general, lowercase names are used for value datatypes like numbers or characters, and uppercase names are used for classes. In C# Int64 is the complex datatype (a structure with fields, properties and methods, see the doc here) for the long value datatype (see the doc here). In general, people don't use the class Int64 for other than invoking methods from that class, such as Int64.Parse. So you will usually find something like this:

long variable = 9.5f;
string text = "8.4";
long anotherVariable = Int64.Parse(text);

这篇关于在C#中接受的风格长期VS Int64的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆