In Visual Studio 2010, this initialization works as expected:
char table[2][2] = {
{'a', 'b'},
{'c', 'd'}
};
But it does not seem legal to write something like:
char table[][] = {
{'a', 'b'},
{'c', 'd'}
};
Visual Studio complains that this array may not contain elements of 'that' type, and after compiling, VS reports two errors: a missing index and too many initializations.
QUESTION: Why can't I omit the dimensions altogether when initializing a multi-dimensional array?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…