C#,int或的Int32?我要在乎? [英] C#, int or Int32? Should I care?

查看:192
本文介绍了C#,int或的Int32?我要在乎?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我的理解 INT 的Int32 在C#同样的事情,但我看过一些倍 INT 是pferred超过的Int32 ,但没有给出任何理由$ p $。那么,是什么原因?我要在乎?

From my understanding int and Int32 are the same thing in C#, but I've read a number of times that int is preferred over Int32 but without any reason given. So, what is the reason? Should I care?

推荐答案

ECMA-334 C#语言规范(第18页):

ECMA-334 C# language specification (page 18):

每个所述predefined类型为系统提供的类型的简写。例如,关键字INT是指结构System.Int32。作为一个风格问题,使用关键字是有利的过度使用完整的系统类型名称。

Each of the predefined types is shorthand for a system-provided type. For example, the keyword int refers to the struct System.Int32. As a matter of style, use of the keyword is favoured over use of the complete system type name.

这篇关于C#,int或的Int32?我要在乎?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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