package main; import "fmt" //结构struct //定义Person结构 type Person struct { name string; age int; }; //结构里面还有一个匿名结构 type Person2 struct { name string; age int; contact struct { phone string; addr string; } } //结构里的匿名字段 type Person3 struct { string;…
假设有这样一个值类型struct. public struct Size { public int Length; public int Width; public int Area() { return Length*Width; } } □ 客户端,给所有struct字段初始化后调用方法 class Program { static void Main(string[] args) { Size size; size.Length = 10; size.Width = 5; Console.…