【发布时间】:2012-11-14 06:57:20
【问题描述】:
我正在使用 Mono Develop For Android,在使用结构数组方面需要一些帮助。
这是我的代码:
public struct overlayItem
{
string stringTestString;
float floatLongitude;
float floatLatitude;
}
当使用这个结构时:
overlayItem[1] items;
items[0].stringTestString = "test";
items[0].floatLongitude = 174.813213f;
items[0].floatLatitude = -41.228162f;
items[1].stringTestString = "test1";
items[1].floatLongitude = 170.813213f;
items[1].floatLatitude = -45.228162f;
我在该行收到以下错误:
overlayItem[1] items;
意外的符号“项目”
能否请我帮忙正确地创建一个上述结构的数组,然后用数据填充它。
谢谢
【问题讨论】:
-
查看 MSDN msdn.microsoft.com/en-us/library/saxz13w4.aspx 上有关 C# 结构的部分
标签: c# arrays struct monodevelop