Я создал структуру под названием «города», и вне структуры я создал массив городов типа с его параметрами. Я пытаюсь получить доступ к этому массиву, но он не работает для меня. Буду признателен за любую помощь!
public struct cities
{
public int x;
public int y;
public int windSpeed;
public string nameCity;
public cities(int _x, int _y, int _windSpeed, string _nameCity)
{
x = _x;
y = _y;
windSpeed = _windSpeed;
nameCity = _nameCity;
}
}
cities[] citywinds =
{
new cities(171,197,1,"Goodland"),
new cities(422,195,1,"Hill City"),
new cities(796,239,1,"Manhattan"),
new cities(908,243,1,"Topeka"),
new cities(941,490,1,"Chanute"),
new cities(706,475,1,"Wichita"),
new cities(389,450,1,"Dodge City"),
new cities(281,418,1,"Garden City"),
new cities(997,110,1,"Cameron"),
new cities(1044,361,1,"El Dorado Springs"),
new cities(1024,577,1,"Monett"),
new cities(749,575,1,"Ponca City"),
new cities(720,95,1,"Beatric"),
new cities(452,92,1,"Kearney"),
new cities(457,573,1,"West Woodward"),
new cities(128,568,1,"Elkhart"),
new cities(120,88,1,"Akron")
};
citywinds[1]._windspeed; //not working