public class myClass
{
myStruct _tmpMyStruc;
//属性
public myStruct MyStruct
{
get{return _tmpMyStruc}
set
{
_tmpMyStruc = value;
}
}
}
{
myStruct _tmpMyStruc;
//属性
public myStruct MyStruct
{
get{return _tmpMyStruc}
set
{
_tmpMyStruc = value;
}
}
}
myStruct tmp = new myStruct();
tmp.s = "ewagawe";
tmp.i = 123;
sss(tmp);//调用函数sss----------------------public void sss(myStruct temp)
{
int aaa = temp.i;
string bbb = temp.s;
..........
}
--------------
是编译器的规定,就是给属性赋的值