コード例 #1
0
ファイル: Program.cs プロジェクト: shyboylpf/csharpBeginToEnd
        private static void Main(string[] args)
        {
            int a = 0;

            test1(ref a);
            Console.WriteLine(a);

            cls model = new cls();

            model.a = 0;
            test2(ref model);
            Console.WriteLine(model.a);

            cls model2 = new cls();

            model2.a = 0;
            test3(model2);
            Console.WriteLine(model2.a);
            Console.WriteLine("Hello World!");
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: shyboylpf/csharpBeginToEnd
 private static void test3(cls model)
 {
     model.a = 1;
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: shyboylpf/csharpBeginToEnd
 private static void test2(ref cls model)
 {
     model.a = 1;
 }