c# 结构体里有一个数组,如何给数组赋值 struct la { int []array; }麻烦高手指教

如题所述

一个个赋值···········,这是最简单的·····,
或者你可以写个函数,吧一个数组的值传递给这个数组也行,那样的话,你就可以这么写
int a[]={...............};
la.array=f(a);
(a是定义的时候赋值,f()函数是你自己写的子函数,完成把一个数组的值赋给另一个数组)
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-11-10
c#还有int *p??
1.先声明一个对象struct la A;
for{int i =0;i<array.GetCount();i++}
{
A.array[i] = array1[i];

}
array1是另一个存你值的数组
第2个回答  2012-11-11
struct la SLA;
int *p = SLA. array.
for(int i =0; i < length(array);i++,p++)
{
Printf("Please input the NO.%d value of the array\n",i+1)
scanf("%d",p);
}