c# 这么知道数组存的是什么类型

如题所述

第1个回答  2014-03-15
那看他是怎么定义的 如 int [] array =new int[4]{1,2,3,4} 或者用反射也可以对象.GetType();
第2个回答  2014-03-15
什么类型的数组就存储什么类型的数据
第3个回答  2014-03-15
if( arr.Length>0)
{
Type t = arr[0].GetType(); // <- 用GetType函数
}本回答被提问者和网友采纳
相似回答
大家正在搜