关于C#类型转换 求教
using System;
namespace test1_constrator
{
class Program
{
static void Main(string[] args)
{
int[] i = new int[10];
float[] f = new float[10];
f = (float)i;
int iiii;
float fff;
fff = iiii;
a[] newA = new a[10];
b[] newB = new b[10];
newA = newB;
}
}
class a
{ }
class b : a
{ }
}
为什么 f = (float)i; 这里会报错??????
int是可以转换为float,那为什么不管我是隐式还是显示转换都活在哪里报错呢???
我查了下资料没说是数组的转换必须是引用类型????为什么必须是引用类型,值类型就不可以。数组的类型转换和普通类型转换有什么差别呢,求解