结构体嵌套代码举例

结构体嵌套举例:

 1 namespace structstudent
 2 {    class Program
 3     {        struct student
 4         {  public string name;
 5            public uint age;
 6            public char sex;
 7            public struct department
 8             {
 9                 public string DepartmentName;
10                 public string DepartmentTel;
11             }
12 }
13         static void Main(string[] args)
14         {   student stu1;
15             student.department  d1;  //嵌套
16             stu1.name="John";
17             d1. DepartmentName ="computer";
18         }   
19 
20     }
21 }
原文地址:https://www.cnblogs.com/fjfhxotfl/p/3419232.html