相关疑难解决方法(0)

整数蓝色,短+ +短问题

C#中的程序:

short a, b;
a = 10;
b = 10;
a = a + b; // Error : Cannot implicitly convert type 'int' to 'short'.

// we can also write this code by using Arithmetic Assignment Operator as given below

a += b; // But this is running successfully, why?

Console.Write(a);
Run Code Online (Sandbox Code Playgroud)

c# int types short

68
推荐指数
4
解决办法
1万
查看次数

标签 统计

c# ×1

int ×1

short ×1

types ×1