结构体 结构体不能重写默认无参构造函数 一位数组 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace m1w2d3_struct_array { //用结构体描述一个学生的信息 struct Student { public Point postion; public Rect body; int…
(一)基本概念 结构体是一个或是多个变量的集合,这些变量可能为不同的类型,为了处理的方便而将这些变量组合在一个名字之下.我们将关键字struct引入了结构声明中.结构声明包含在花括号内的一系列声明组成.例如: // 以下是一个巨普通的结构体,表示坐标. // point 为结构标记:x, y为成员. struct point { int x; int y; }: // 以下是跟变量表的情形 struct point { int x; int y; }px, py, pz: (二)使用方法…