char monsternivel1[][3][4] = {
{"Rat","Bat","Spider"},
{"Goblin","Orc","Drawf"},
{"Dragon","Lich","Banshee"},
{"Demon","Hydra","Giant Spider"}
};
それは言います:
> E:\Dungeon Crawler.c||In function 'rndMonster':| E:\Dungeon
> Crawler.c|10|warning: initializer-string for array of chars is too
> long [enabled by default]| E:\Dungeon Crawler.c|10|warning: (near
> initialization for 'monsternivel1[0][2]') [enabled by default]|
> E:\Dungeon Crawler.c|11|warning: initializer-string for array of chars
> is too long [enabled by default]| E:\Dungeon Crawler.c|11|warning:
> (near initialization for 'monsternivel1[1][0]') [enabled by default]|
> E:\Dungeon Crawler.c|11|warning: initializer-string for array of chars
> is too long [enabled by default]| E:\Dungeon Crawler.c|11|warning:
> (near initialization for 'monsternivel1[1][2]') [enabled by default]|
> E:\Dungeon Crawler.c|12|warning: initializer-string for array of chars
> is too long [enabled by default]| E:\Dungeon Crawler.c|12|warning:
> (near initialization for 'monsternivel1[2][0]') [enabled by default]|
> E:\Dungeon Crawler.c|12|warning: initializer-string for array of chars
> is too long [enabled by default]| E:\Dungeon Crawler.c|12|warning:
> (near initialization for 'monsternivel1[2][2]') [enabled by default]|
> E:\Dungeon Crawler.c|13|warning: initializer-string for array of chars
> is too long [enabled by default]| E:\Dungeon Crawler.c|13|warning:
> (near initialization for 'monsternivel1[3][0]') [enabled by default]|
> E:\Dungeon Crawler.c|13|warning: initializer-string for array of chars
> is too long [enabled by default]| E:\Dungeon Crawler.c|13|warning:
> (near initialization for 'monsternivel1[3][1]') [enabled by default]|
> E:\Dungeon Crawler.c|13|warning: initializer-string for array of chars
> is too long [enabled by default]| E:\Dungeon Crawler.c|13|warning:
> (near initialization for 'monsternivel1[3][2]') [enabled by default]|
char の 3 次元配列がわかりませんでした。何かアイデアはありますか? 最初の [] は変数、2 番目の [] は文字列の数、3 番目はカテゴリですか?