I have a parameters struct:
public struct MyParams
{
public int Param1;
public int Param2;
public string Param3;
public string Param4;
}
This is a common structure to use across application. And there are some situation in wich I need initialize only one member, all another is not used. I can Initialize struct this way:
MyParams testParams = default(MyParams);
testParams.Param2 = 3;
FunctionX(testParams);
Also I can initialize struct direct in function call, but in this case I must specify values for all members:
FunctionX(new MyParams{Param1=0,Param2=3,Param3=string.Empty,Param4=string.Empty});
My question is Can I Initialize structure in function call line and specify only one sufficient for me member and another members will take default value
Thanks in advance!