Re: [問題] struct 結構問題

看板C_Sharp作者 (卡瓦那久久久)時間15年前 (2010/05/06 15:41), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/4 (看更多)
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
文章代碼(AID): #1BudAHKv (C_Sharp)
文章代碼(AID): #1BudAHKv (C_Sharp)