面向对象之struct

    struct PointStruct
    {
        int pointx = 1;
        int pointy = 2;

        public PointStruct(int x, int y)
        {
            this.pointx = x;
            this.pointy = y;
        }
    }
    public class test
    {
        PointStruct s = new PointStruct();
    }

  struct是值类型,用来封装一组数据和一些简单处理数据的方法

原文地址:https://www.cnblogs.com/mingjia/p/4570500.html