コード例 #1
0
        static void Main(string[] args)
        {
            NameStruct ns = new NameStruct();

            ns.FirstName = "Tiandre";
            ns.LastName  = "Turner";
            Console.WriteLine($"Full name is {ns.FullName()}");

            ChangeName(ns);

            Console.WriteLine($"Full name is {ns.FullName()}");
        }
コード例 #2
0
 static void ChangeName(NameStruct ns)
 {
     Console.WriteLine($"In method ChangeName, the current full name is {ns.FullName()}");
     ns.ChangeName("Keith", "Waterman");
     Console.WriteLine($"In method ChangeName, the current full name is {ns.FullName()}");
 }