예제 #1
0
파일: Program.cs 프로젝트: K1kk3rt/S1.4_OO
        static void Main(string[] args)
        {
            PersoonStruct p1 = new PersoonStruct("Simon", 40);
            PersoonClass  p2 = new PersoonClass("Chris", 50);

            Console.WriteLine("struct persoon: " + p1.naam + ", " + p1.leeftijd);
            Console.WriteLine("class persoon: " + p2.naam + ", " + p2.leeftijd);
            Console.WriteLine();
            WijzigLeeftijd(ref p1);
            WijzigLeeftijd(p2);
            Console.WriteLine("struct persoon: " + p1.naam + ", " + p1.leeftijd);
            Console.WriteLine("class persoon: " + p2.naam + ", " + p2.leeftijd);
            Console.WriteLine();
            Console.ReadKey();
        }
예제 #2
0
파일: Program.cs 프로젝트: K1kk3rt/S1.4_OO
 static void WijzigLeeftijd(PersoonClass p)
 {
     p.leeftijd++;
 }