我收到以下错误:
数组初始值设定项只能用于变量或字段初始值设定项。尝试改用新的表达式。
这是我的代码:
// Declare listbox information array
string [] tablet = new string[]{{"Microsoft Surface Price: $1,162.99 Screen Size: 10.6 Inches Storage Capacity: 128 GB"},
{"iPad 2 Price: $399.99, Screen Size: 9.7 Inches, Storage Capacity 16 GB"},
{"Samsung Galaxy Tab 2 Price: $329.99, Screen Size: 10.1 Inches, Storage Capacity 16 GB"},
{"NOOK HD Price: $199.99, Screen Size: 7 Inches, Storage Capacity 8 GB"},
{"IdeaTab Price: $149.99, Screen Size: 7 Inches, Storage Capacity: 8 GB"}};
//Array of product prices
int [] tabletPricesArray = new int[]{{"$1,162.99"},
{"$399.99"},
{"$329.99"},
{"$199.99"},
{"$149.99"}};
我不太确定出了什么问题。我对 C# 比较陌生。让我知道是否需要任何其他信息。