[問題] struct
我宣告一個struct...
struct Student
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public int[] No;
}
然後在Main裡面
Student[] stu = new Student[50];
則
stu[1].No[2] = 5;
不知道這個式子為什麼會錯誤??
是不是沒有new?
換用class可以解決嗎?
= ="剛學C#不太熟...麻煩高手指教...謝謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.223.99.12
推
10/16 20:11, , 1F
10/16 20:11, 1F
討論串 (同標題文章)