12

struct结构

//struct 结构

//包含多个节本类型或符合类型的复合体

//优点操作效率比较高

using System;

using System.Collections.Generic;

using System.Text;

namespace @struct

{

class Program

{

static void Main(string[] args)

{

People p1 = new People();

p1.Page = 20;

p1.Psex = "man";

p1.Pname = "yugang";

People p2;

p2 = p1;

p2.Page = 10 ;

p2.Pname = "yuyue";

Console.Write(p2.Psex);

Console.Read();

}

public struct People

{

public int Page;

public string Pname;

public string Psex;

}

}

}

posted @ 2009-01-19 13:03  ygang  阅读(189)  评论(0编辑  收藏  举报
12