Beispiel #1
0
        public static void Main(string[] args)
        {
            CustomerStruct customer=new CustomerStruct();
            System.Console.WriteLine("Struct values before initialization");
            System.Console.WriteLine("ID={0},Name={1}",customer.ID,customer.name);

            customer.ID=100;
            customer.name="Robert";
            System.Console.WriteLine("Struct values after initialization");
            System.Console.WriteLine("ID={0},Name={1}",customer.ID,customer.name);
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            CustomerStruct customer = new CustomerStruct();

            System.Console.WriteLine("Struct values before initialization");
            System.Console.WriteLine("ID={0},Name={1}", customer.ID, customer.name);

            customer.ID   = 100;
            customer.name = "Robert";
            System.Console.WriteLine("Struct values after initialization");
            System.Console.WriteLine("ID={0},Name={1}", customer.ID, customer.name);
        }