zoukankan      html  css  js  c++  java
  • C#结构体

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    /*
     * 结构是自定义的数据类型,与类类似,包含数据成员和函数成员
     * 1、结构是值类型
     * 2、结构是隐式密封的不可以派生
     * 3、结构中字段初始化是不允许的
     */
    namespace ExStruct
    {
        struct Simple
        {
            public int x;
            public int y;
            public Simple(int _x, int _y)
            {
                x = _x;
                y = _y;
            }
        }
        class Program
        {
            static void Main(string[] args)
            {
                Simple s1 = new Simple();
                s1.x = 10; s1.y = 90;
                Console.WriteLine("x:{0},y:{1}", s1.x, s1.y);
                Simple s2 = new Simple(9,9);
                Console.WriteLine("x:{0},y:{1}", s2.x, s2.y);
                Console.ReadKey();
            }
        }
    }
  • 相关阅读:
    Linux内存管理和应用
    Linux之IRQ domain
    Sass的的使用三
    Sass的的使用二
    Sass的的使用一
    sass的使用
    jQuery核心语法
    jQuery动画处理
    jQuery事件总结
    jQuery 的DOM操作
  • 原文地址:https://www.cnblogs.com/sulong/p/4797246.html
Copyright © 2011-2022 走看看