【问题标题】:What code is "int pos" within vb.net? [closed]vb.net 中的“int pos”是什么代码? [关闭]
【发布时间】:2013-12-19 23:29:52
【问题描述】:

vb.net 中的“int pos”是什么代码?

需要有人翻译。

赞赏,

【问题讨论】:

标签: vb.net console int


【解决方案1】:

C#

int pos;

等于:

VB.NET

Dim pos as Integer

【讨论】:

    【解决方案2】:

    在 VB.NET 中很简单:

    dim pos as integer
    

    在 C# 中是:

    int pos;
    

    【讨论】:

      【解决方案3】:

      是的,正确的 VB 或 vb.net 以这种方式声明一个变量,将 a 调为整数。所以你需要以同样的方式将 Dim pos 作为整数。

      【讨论】:

        【解决方案4】:

        C# int 关键字表示一个带符号的 32 位整数,解析为 System.Int32 结构。

        C# 32 位有符号整数的 VB.NET 对应项是 Integer,您可以声明一个,如下所示:

        Dim pos As Integer
        

        注意:也可以使用 System.Int32 的 .NET Framework 结构,但很少这样做,因为存在可解析这些结构的语言关键字,并且通常比 System 对应物更具吸引力。

        C#:

        System.Int32 pos;
        

        VB.NET:

        Dim pos As System.Int32
        

        对于整数类型,以下是 C# 和 VB.NET 如何支持它们的细分:

        16 位整数

        • short (C#)
        • Short (VB.NET)
        • System.Int16(.NET 框架)

        32 位整数

        • int (C#)
        • Integer (VB.NET)
        • System.Int32(.NET 框架)

        64 位整数

        • long (C#)
        • Long (VB.NET)
        • System.Int64(.NET 框架)

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2021-07-09
          • 1970-01-01
          • 2017-04-03
          • 2017-02-12
          • 1970-01-01
          • 1970-01-01
          • 2014-03-26
          • 1970-01-01
          相关资源
          最近更新 更多