我正在创建一个包含 C 中字符串数组的数组。我有一个名为 conditionType 的枚举,用于通过条件数组的第一个索引进行访问。
enum conditionType {
CLEAR = 0,
OVERCAST,
CLOUDY,
RAIN,
THUNDERSTORM,
SNOW
};
int conditionsIndex[6] = {
CLEAR, OVERCAST, CLOUDY, RAIN, THUNDERSTORM, SNOW};
const char *conditions[][count] = {
// CLEAR
{
"Clear" }
,
// OVERCAST
{
"Overcast","Scattered Clouds", "Partly Cloudy" }
,
// CLOUDY
{
"Shallow Fog","Partial Fog","Mostly Cloudy","Fog","Fog Patches","Smoke" }
,
// RAIN
{
"Drizzle",
"Rain",
"Hail",
"Mist",
"Freezing Drizzle",
"Patches of Fog",
"Rain Mist",
"Rain Showers",
"Unknown Precipitation",
"Unknown",
"Low Drifting Widespread Dust",
"Low Drifting Sand" }
,
// THUNDERSTORM
{
"Thunderstorm",
"Thunderstorms and Rain",
"Thunderstorms and Snow",
"Thunderstorms and Ice Pellets",
"Thunderstorms with Hail",
"Thunderstorms with Small Hail",
"Blowing Widespread Dust",
"Blowing Sand",
"Small Hail",
"Squalls",
"Funnel Cloud" }
,
// SNOW
{
"Volcanic Ash",
"Widespread Dust",
"Sand",
"Haze",
"Spray",
"Dust Whirls",
"Sandstorm",
"Freezing Rain",
"Freezing Fog",
"Blowing Snow", "Snow Showers",
"Snow Blowing Snow Mist",
"Ice Pellet Showers",
"Hail Showers",
"Small Hail Showers",
"Snow",
"Snow Grains",
"Low Drifting Snow",
"Ice Crystals",
"Ice Pellets" }
};
我是 C 新手,我想知道这条线上需要多少数字
const char *conditions[][count]
假设每个子数组的大小不同。