结构类型是一种可封装数据和相关功能的值类型。 使用 struct 关键字定义结构类型:
[public] struct 结构名{
	成员;//字段
}
变量在程序运行期间只能存储一个值,而字段可以存储多个值。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Demo {
    //结构
    public struct Person {
        public string _name;//字段
        public int _age;   
    }
    class Program {
        static void Main(string[] args) {
            Person zsPerson;
            zsPerson._name = "张三";
            zsPerson._age = 20;
            Person lsPerson;
            lsPerson._name = "李四";
            lsPerson._age = 15;
            Console.WriteLine(zsPerson._name);  
            Console.WriteLine(lsPerson._name);  
            Console.ReadKey();
        }
    }
}
运行结果:

原文:https://www.cnblogs.com/lz32158/p/12820102.html