public static void RunTest(bool isRun) { if (!isRun) { return; } CArgType tmp = new CArgType(); tmp._i_member = 200; CArgType.ChangeObjV0(tmp); Console.WriteLine("tmp._i_member = " + tmp._i_member); CArgType.ChangeObjV1(ref tmp); Console.WriteLine("tmp._i_member = " + tmp._i_member); CArgType.ChangeObjV2(out tmp); Console.WriteLine("tmp._i_member = " + tmp._i_member); int tmpV = 200; CArgType.ChangeValueV0(tmpV); Console.WriteLine("tmpV = " + tmpV); CArgType.ChangeValueV1(ref tmpV); Console.WriteLine("tmpV = " + tmpV); CArgType.ChangeValueV2(out tmpV); Console.WriteLine("tmpV = " + tmpV); }
public static void ChangeObjV2(out CArgType arg) { arg = new CArgType(); arg._i_member += 1; }
public static void ChangeObjV1(ref CArgType arg) { arg._i_member += 1; }