값이 유형 t 인 참조를 나타내는 값이 있습니다.C# System.Double & to System.Double
: System.Double & 또는 System.Double은 [] &은 ... 는 지금은 유형 System.Double 또는 System.Double [], ...질문 편집과 개체의 인스턴스를 만들고 싶습니다
Type t = param.ParameterType;
if (t == Type.GetType("System.String&"))
return Activator.CreateInstance(Type.GetType("System.String"), new object[] { new char[] { ' ' } });
if (t == Type.GetType("System.Double[]&"))
return Activator.CreateInstance(Type.GetType("System.Dobule[]"), new object[] { 10 }); // throw Error !!!!
else
return Activator.CreateInstance(t.GetElementType());
편집 2 : 나는 이런 식으로 뭔가를 구현하고자 :
Type t = param.ParameterType;
if t is a reference to an array of any dimensions -> create its instance
if t is a ref to string -> create its instance
if t is a ref to any other data types -> create its instance
'System.Double &'및'System.Double && '란 무엇입니까? o.O –
C#에 대해 이야기하고 있습니까? – Baldrick
이것에 대해 더 자세히 설명해 주시겠습니까? –