作者kavana999 (卡瓦那久久久)
看板C_Sharp
标题Re: [问题] struct 结构问题
时间Thu May 6 15:41:00 2010
public struct Customer
{
public string name;
public int age;
public char sex ;
}
static void Main(string[] args)
{
Customer ct=new Customer();
List<Customer> clist=new List<Customer>();
ct.name = "乡民";
ct.age = 20;
ct.sex = 'M';
clist.Add(ct);
Console.WriteLine("Name:{0},\tAge:{1},\tSex:{2}", clist[0].name,
clist[0].age, clist[0].sex);
}
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.22.18.86